PHP 4.0 Bug #7387: weird problems with unquoted array subscripts
| From: | delme at jumeaux dot bc dot ca | Date: | Sun, 22 Oct 2000 03:32:40 +0000 |
| Subject: | PHP 4.0 Bug #7387: weird problems with unquoted array subscripts | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35747@lists.php.net to get a copy of this message | ||
From: delme@jumeaux.bc.ca
Operating system: linux 2.2
PHP version: 4.0.3pl1
PHP Bug Type: Scripting Engine problem
Bug description: weird problems with unquoted array subscripts
I think it's better simply to demonstrate this bug or bugs than to try and explain it.
given this code:
<?
$test[Null]='a test with capitals';
$test[null]='a test with all lower case';
$empty[Null]='';
$filled[Null]='test';
print "\$test[Null] = '";
print $test[Null];
print "'<BR>\$test[Null] (interpolated) = '$test[Null]'<BR>";
print "\$test[null] = '";
print $test[null];
print "'<BR>\$test[null] (interpolated) = '$test[null]'<BR>";
print "!\$math[Null] = '";
print !$empty[Null];
print "'<BR>!\$filled[Null] = '";
print !$filled[Null];
print "'<BR>";
?>
under php3 i got what i would expect:
$test[Null] = 'a test with capitals'
$test[Null] (interpolated) = 'a test with capitals'
$test[null] = 'a test with all lower case'
$test[null] (interpolated) = 'a test with all lower case'
!$math[Null] = '1'
!$filled[Null] = '0'
but under 4.0.3pl1 (and 4.0.1pl2) i get:
$test[Null] = 'a test with all lower case'
$test[Null] (interpolated) = ''
$test[null] = 'a test with all lower case'
$test[null] (interpolated) = ''
!$math[Null] = '1'
!$filled[Null] = ''
something is very wrong.
--
Edit Bug report at: http://bugs.php.net/?id=7387&edit=1