cvs: php-src(PHP_4_3) /ext/standard/tests/array bug21918.phpt

From: Date: Wed, 13 Aug 2003 09:48:32 +0000
Subject: cvs: php-src(PHP_4_3) /ext/standard/tests/array bug21918.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-23157@lists.php.net to get a copy of this message
sniper Wed Aug 13 05:48:32 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/standard/tests/array bug21918.phpt Log: MFH Index: php-src/ext/standard/tests/array/bug21918.phpt diff -u php-src/ext/standard/tests/array/bug21918.phpt:1.1.2.1 php-src/ext/standard/tests/array/bug21918.phpt:1.1.2.2 --- php-src/ext/standard/tests/array/bug21918.phpt:1.1.2.1 Mon Aug 11 16:19:19 2003 +++ php-src/ext/standard/tests/array/bug21918.phpt Wed Aug 13 05:48:32 2003 @@ -1,36 +1,36 @@ ---TEST-- ---FILE-- -<?php - -echo "==Mixed==\n"; -$a = array(-1=>'a', '-2'=>'b', 3=>'c', '4'=>'d', 5=>'e', '6001'=>'f', '07'=>'g'); - -foreach($a as $k => $v) { - var_dump($k); - var_dump($v); -} - -echo "==Normal==\n"; -$b = array(); -$b[] = 'a'; - -foreach($b as $k => $v) { - var_dump($k); - var_dump($v); -} - -echo "==Negative==\n"; -$c = array('-2' => 'a'); -$c[] = 'b'; - -foreach($c as $k => $v) { - var_dump($k); - var_dump($v); -} - -echo "==Done==\n"; -?> ---EXPECT-- +--TEST-- +Bug #21918 (different handling of positive vs. negative array indexes) +--FILE-- +<?php + +echo "==Mixed==\n"; +$a = array(-1=>'a', '-2'=>'b', 3=>'c', '4'=>'d', 5=>'e', '6001'=>'f', '07'=>'g'); + +foreach($a as $k => $v) { + var_dump($k); + var_dump($v); +} + +echo "==Normal==\n"; +$b = array(); +$b[] = 'a'; + +foreach($b as $k => $v) { + var_dump($k); + var_dump($v); +} + +echo "==Negative==\n"; +$c = array('-2' => 'a'); + +foreach($c as $k => $v) { + var_dump($k); + var_dump($v); +} + +echo "==Done==\n"; +?> +--EXPECT-- ==Mixed== int(-1) string(1) "a" @@ -46,12 +46,10 @@ string(1) "f" string(2) "07" string(1) "g" -==Normal== -int(0) +==Normal== +int(0) string(1) "a" ==Negative== -int(-2) +int(-2) string(1) "a" -int(-1) -string(1) "b" -==Done== +==Done==

« previous php.cvs (#23157) next »