From:             [EMAIL PROTECTED]
Operating system: linux
PHP version:      4.1.2
PHP Bug Type:     *Programming Data Structures
Bug description:  Incompatible behaviour of arrays (and maybe other vars)

In PHP 4.0 you can write the following:

...
$a='';
if ( empty($a['bla']) )
...

There are no errors or warnings, even if all warnings has been put on (as
we do).

in PHP 4.1 this code complains the missing index 'bla':
Warning: Uninitialized string offset: 0 in  ....

Workarround:

if ( empty($a) and empty($a['bla']) ) ....

which seems not to be very logical. $a['bla'] must be empty, if $a is
empty...


-- 
Edit bug report at http://bugs.php.net/?id=16528&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16528&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16528&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16528&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16528&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16528&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16528&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16528&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16528&r=submittedtwice

Reply via email to