Bug #16528 Updated: Incompatible behaviour of arrays (and maybe other vars)

From: Date: Wed, 10 Apr 2002 10:21:41 +0000
Subject: Bug #16528 Updated: Incompatible behaviour of arrays (and maybe other vars)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-4524@lists.php.net to get a copy of this message
ID: 16528 Updated by: sander@php.net Reported By: ssilk@fidion.de -Status: Open +Status: Feedback -Bug Type: *Programming Data Structures +Bug Type: Variables related Operating System: linux PHP Version: 4.1.2 New Comment: Can you try 4.2.0RC2 or 3 from www.php.net/~derick? Previous Comments: ------------------------------------------------------------------------ [2002-04-10 06:05:18] ssilk@fidion.de 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 this bug report at http://bugs.php.net/?id=16528&edit=1

« previous php.bugs (#4524) next »