#42419 [NEW]: array_sort bombs depending on input array

From: Date: Fri, 24 Aug 2007 23:25:18 +0000
Subject: #42419 [NEW]: array_sort bombs depending on input array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116644@lists.php.net to get a copy of this message
From: bug at nyvegetarianexpo dot org Operating system: Linux PHP version: 5.2.3 PHP Bug Type: Reproducible crash Bug description: array_sort bombs depending on input array Description: ------------ Depending on the array passed to it, the built in function array_sort will never return and all output after it be lost. The code needed to reproduce this bug is embassingly simply. It will bomb on an array of length two, but also others, but not all arrays. It actually works for some. I am not privy to all their compilation/configuration options, but I have run into this problem with two HSPs both on a linux box. I can print_r(get_defined_constants()); if desired, however. Reproduce code: --------------- <HTML><TITLE>Array_sort bug test</TITLE><BODY> <pre> <?php $a[] = '2007-09-15 10:00:00'; $a[] = '2007-09-15 16:00:00'; print_r($a); echo "\nHANGS...\n"; array_sort($a); print_r($a); ?> </pre> <b>No, it works!</b> </BODY> </HTML> Expected result: ---------------- Array ( [0] => 2007-09-15 10:00:00 [1] => 2007-09-15 16:00:00 ) HANGS... Array ( [0] => 2007-09-15 10:00:00 [1] => 2007-09-15 16:00:00 ) No, it works! Actual result: -------------- Array ( [0] => 2007-09-15 10:00:00 [1] => 2007-09-15 16:00:00 ) HANGS... -- Edit bug report at http://bugs.php.net/?id=42419&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42419&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42419&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42419&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42419&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42419&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42419&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42419&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42419&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42419&r=support Expected behavior: http://bugs.php.net/fix.php?id=42419&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42419&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42419&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42419&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42419&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42419&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42419&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42419&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42419&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42419&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42419&r=mysqlcfg

« previous php.bugs (#116644) next »