#18773 [Opn->Ver]: Quicksort result is different between Windows and Unix.
| From: | eru@php.net | Date: | Wed, 07 Aug 2002 09:02:12 +0000 |
| Subject: | #18773 [Opn->Ver]: Quicksort result is different between Windows and Unix. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16132@lists.php.net to get a copy of this message | ||
ID: 18773
Updated by: eru@php.net
Reported By: rgaidot@swt.fr
-Status: Open
+Status: Verified
-Bug Type: Unknown/Other Function
+Bug Type: Arrays related
Operating System: Windows 2000 Pro
-PHP Version: 4.2.0
+PHP Version: 4CVS-2002-08-07
New Comment:
reclassified, updated version, verified
Previous Comments:
------------------------------------------------------------------------
[2002-08-07 04:46:18] rgaidot@swt.fr
I have tried to use the sort function on a string array. The array
strings include both integer and char characters.
(e.g. 0000AER, 000000S0, 00000073)
I have noted that the result differs between the two systems Windows
and Unix. Indeed the result on Unix is correct, but it is not correct
on Windows.
I have made a C++ test application in order to compare the results
between the two systems and I did not note any problem.
<PHPScript_Test>
$a=array(
array('000000S0','1','5'),
array('000000O2','2','4'),
array('000000D2','3','3'),
array('000000MH','4','2'),
array('00000073','5','1')
);
echo "<h1>Data</h1>";
echo "<pre>";
var_dump($a);
echo "</pre>";
sort($a);
echo "<h1>Result</h1>";
echo "<pre>";
var_dump($a);
echo "</pre>";
</PHPScript_Test>
Thanks,
Régis Gaidot
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18773&edit=1