Re: [PHP] empty function and array indices

2005-05-01 Thread Richard Lynch
On Sun, May 1, 2005 1:47 pm, Gabriel Birke said: > Is empty() some kind of special function where the validity > of indices is not checked? Bingo! That's rather the whole point of empty and isset. :-) The behaviour of empty has changed over time, with various releases. isset seems more "stable"

Re: [PHP] empty function and array indices

2005-05-01 Thread Mark Cain
cho array_key_exists('c', $a)? 'empty':'not empty'; Mark Cain - Original Message - From: "Gabriel Birke" <[EMAIL PROTECTED]> To: Sent: Sunday, May 01, 2005 4:47 PM Subject: [PHP] empty function and array indices > Hello! > > Suppos

Re: [PHP] empty function and array indices

2005-05-01 Thread Rasmus Lerdorf
Gabriel Birke wrote: Hello! Suppose I have the following code: $a = array('a'=>1, 'b'=>2); echo empty($a['c'])?'empty':'not empty'; echo $a['c']; Why doesn't the 2nd line output a warning when error_reporting is set to E_ALL? Is empty() some kind of special function where the validity of indices is

[PHP] empty function and array indices

2005-05-01 Thread Gabriel Birke
Hello! Suppose I have the following code: $a = array('a'=>1, 'b'=>2); echo empty($a['c'])?'empty':'not empty'; echo $a['c']; Why doesn't the 2nd line output a warning when error_reporting is set to E_ALL? Is empty() some kind of special function where the validity of indices is not checked? If t