Bug #16528: Incompatible behaviour of arrays (and maybe other vars)
| From: | ssilk at fidion dot de | Date: | Wed, 10 Apr 2002 10:05:19 +0000 |
| Subject: | Bug #16528: Incompatible behaviour of arrays (and maybe other vars) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-4523@lists.php.net to get a copy of this message | ||
From: ssilk@fidion.de
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