Bug #764: ksort mixes the implicit variable types and result is unexpected.
| From: | libs at cybercable dot tm dot fr | Date: | Mon, 21 Sep 1998 17:29:31 +0000 |
| Subject: | Bug #764: ksort mixes the implicit variable types and result is unexpected. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-1331@lists.php.net to get a copy of this message | ||
From: libs@cybercable.tm.fr
Operating system: Linux
PHP version: 3.0.3
PHP Bug Type: Misbehaving function
Bug description: ksort mixes the implicit variable types and result is unexpected.
<?
$toto["001"]="a";
$toto["010"]="c";
$toto[(string)"100"]="d";
$toto["002"]="b";
$toto["110"]="e";
ksort($toto);
for(reset($toto); $test = key($toto); next($toto)) {
echo ($test." (".gettype($test).") : ".$toto[$test]."<BR>\n");
};
?>
gives
100 (integer) : d<BR>
110 (integer) : e<BR>
001 (string) : a<BR>
002 (string) : b<BR>
010 (string) : c<BR>
instead of :
001 (whatever) : a<BR>
002 (whatever) : b<BR>
010 (whatever) : c<BR>
100 (whatever) : d<BR>
110 (whatever) : e<BR>
Linux
php3.0.3
./configure --with-apache=/home/www/apache_1.3.0 --with-mysql=/usr
--with-config-file-path=/home/www/apache_1.3.0/etc --with-exec-dir=/home/www/safe-bin
--enable-track-vars=yes --enable-magic-quotes=yes --enable-bcmath=yes
php3.ini irrelevant I guess.
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net