ID: 17449
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Feedback
Bug Type: Arrays related
Operating System: Digital UNIX V4.0G (Rev. 1530)
PHP Version: 4.2.1
New Comment:
This may be related to a casting problem which is supposed to be fixed
in HEAD, please try this version (snapshots are available at
snaps.php.net), thx.
Previous Comments:
------------------------------------------------------------------------
[2002-05-27 17:19:01] [EMAIL PROTECTED]
4.2.0RC1 introduced the new sorting code Zend/zend_qsort.c from
Sterling, maybe that's related?
------------------------------------------------------------------------
[2002-05-27 15:42:16] [EMAIL PROTECTED]
Bug #17257 seems to be the same problem ("Digital UNIX OSF/1" is the
old name of "Compaq Tru64"). People there found that all sort functions
broke with PHP-4.2.0RC1, I can confirm this now.
Smallest test program:
<?php
$a = array(9,7,3,5);
sort($a);
print_r($a);
?>
Output:
Array
(
[0] => 9
[1] => 7
[2] => 3
[3] => 5
)
It's not compiler-related, both gcc-2.95.2 and Compac C V6.3-129 give
the same results. Maybe endianess-related (the Compaq machine have
Alpha processors)?
If somebody more clueful wants to take a look at this problem: Compaq
provides free test accounts (not only with Tru64, but also with
FreeBSD, NetBSD and Linux), see
<http://www.testdrive.compaq.com/>.
I compiled PHP-4.2.0RC1 there on FreeBSD/Alpha, and gcc-2.95.3 gives
lots of warnings:
*** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM
But even with CFLAGS="-O0 -g" sort() does not sort at all.
On FreeBSD/Intel it does work, so it probably is an endianess problem.
------------------------------------------------------------------------
[2002-05-27 14:29:54] [EMAIL PROTECTED]
Well,
the script runs fine under my IRIX64 6.5.16m on mod_php/Apache 1.3.24
but not when using a 64bit cgi binary with Apache2.
Case 1
http://sgi.takenet.de/php/sort.php
Case 2
http://sgi.takenet.de:8080/php/sort.php
------------------------------------------------------------------------
[2002-05-27 11:11:05] [EMAIL PROTECTED]
I checked some older versions:
until PHP-4.1.2, sort() was fine. I didn't check 4.2.0RC*, yet, but
will do so tomorrow.
------------------------------------------------------------------------
[2002-05-27 10:44:43] [EMAIL PROTECTED]
Updated version according to Michaels tests.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/17449
--
Edit this bug report at http://bugs.php.net/?id=17449&edit=1