Bug #1859: echo does not handle double scripted arrays

From: Date: Sat, 24 Jul 1999 01:36:15 +0000
Subject: Bug #1859: echo does not handle double scripted arrays
Groups: php.dev 
Request: Send a blank email to php-dev+get-9081@lists.php.net to get a copy of this message
From: tim@inttek.com Operating system: Multiple PHP version: 3.0.11 PHP Bug Type: Misbehaving function Bug description: echo does not handle double scripted arrays --- Script 1 --- echo("Start...<br>n"); $x[0][0] = "A"; $x[0][1] = "B"; $x[1][0] = "C"; $x[1][1] = "D"; $size = sizeof($x); echo("X array size = $size<br>n"); for ($i = 0; $i < $size; $i++) { $current_size = sizeof($x[$i]); echo("x[$i] size = $current_size<br>n"); for ($j = 0; $j < $current_size; $j++) { echo("x[$i][$j] = $x[$i][$j]<br>n"); // FAILS } } echo("Done..."); ?> ---- Script 2 ---- <? echo("Start...<br>n"); $x[0][0] = "A"; $x[0][1] = "B"; $x[1][0] = "C"; $x[1][1] = "D"; $size = sizeof($x); echo("X array size = $size<br>n"); for ($i = 0; $i < $size; $i++) { $current_size = sizeof($x[$i]); echo("x[$i] size = $current_size<br>n"); for ($j = 0; $j < $current_size; $j++) { printf("x[$i][$j] = %s<br>n",$x[$i][$j]); // WORKS } } echo("Done..."); ?> --- Peter van Roosmalen has posted examples of this bug on the following systems --- www.peerke.com (Apache 1.2.6 PHP 3.0RC3) www.roosmalen.com (Apache 1.3.4 PHP 3.07) home.cybercomm.nl (Apache 1.3.4 PHP 3.07) URLS: http://www.peerke.com/bug1.php3 http://www.peerke.com/bug2.php3 http://www.peerke.com/php.php3 http://www.roosmalen.com/bug1.php3 http://www.roosmalen.com/bug2.php3 http://www.roosmalen.com/php.php3 http://home.cybercomm.nl/~peerke/bug1.php3 http://home.cybercomm.nl/~peerke/bug2.php3 http://home.cybercomm.nl/~peerke/php.php3

« previous php.dev (#9081) next »