PHP 4.0 Bug #2689: asort behaviour changed over the week-end ?
| From: | Danny dot Heijl at cevi dot be | Date: | Tue, 09 Nov 1999 18:53:00 +0000 |
| Subject: | PHP 4.0 Bug #2689: asort behaviour changed over the week-end ? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12245@lists.php.net to get a copy of this message | ||
From: Danny.Heijl@cevi.be
Operating system: RH 6.0 Linux
PHP version: 4.0 Latest CVS (09/11/1999)
PHP Bug Type: Scripting Engine problem
Bug description: asort behaviour changed over the week-end ?
The following script :
<?php
$a[0] = 1;
$a[r] = 2;
$a[4] = 3;
$a[c] = three;
$a[d] = one;
$a[a] = two;
?>
Before being sorted
-------------------
<?php
reset($a);
$b = current($a);
while ($b != "") {
echo "\$a[" . key($a) . "]=$b\n";
$b = next($a);
}
asort($a);
?>
After being sorted
-------------------
<?php
reset($a);
$b = current($a);
while ($b != "") {
echo "\$a[" . key($a) . "]=$b\n";
$b = next($a);
}
?>
gives the following output :
Content-Type: text/html
Before being sorted
-------------------
$a[0]=1
$a[r]=2
$a[4]=3
$a[c]=three
$a[d]=one
$a[a]=two
After being sorted
-------------------
$a[d]=one
$a[c]=three
$a[a]=two
$a[0]=1
$a[r]=2
$a[4]=3
While last week it produced (and so does php3 3.0.12) :
Content-Type: text/html
Before being sorted
-------------------
$a[0]=1
$a[r]=2
$a[4]=3
$a[c]=three
$a[d]=one
$a[a]=two
After being sorted
-------------------
$a[0]=1
$a[r]=2
$a[4]=3
$a[d]=one
$a[c]=three
$a[a]=two
Danny
---