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"
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
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
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
4 matches
Mail list logo