Bug #70770 [NEW]: Natsort: different results for PHP5 and PHP7

From: Date: Thu, 22 Oct 2015 13:41:55 +0000
Subject: Bug #70770 [NEW]: Natsort: different results for PHP5 and PHP7
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196746@lists.php.net to get a copy of this message
From: tronsha at gmx dot de Operating system: PHP version: 7.0Git-2015-10-22 (Git) Package: *General Issues Bug Type: Bug Bug description:Natsort: different results for PHP5 and PHP7 Description: ------------ --- From manual page: http://www.php.net/function.natsort --- I get different results for PHP5 and PHP7 PHP 5 Array ( [5] => 0 [1] => 8 [3] => 009 [0] => 09 [2] => 10 [4] => 011 ) PHP 7 (dev) Array ( [5] => 0 [1] => 8 [0] => 09 [3] => 009 [2] => 10 [4] => 011 ) Test script: --------------- <?php $zeros = array('09', '8', '10', '009', '011', '0'); natsort($zeros); print_r($zeros); Expected result: ---------------- Array ( [5] => 0 [1] => 8 [3] => 009 [0] => 09 [2] => 10 [4] => 011 ) Actual result: -------------- Array ( [5] => 0 [1] => 8 [0] => 09 [3] => 009 [2] => 10 [4] => 011 ) -- Edit bug report at https://bugs.php.net/bug.php?id=70770&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70770&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70770&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70770&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70770&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70770&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70770&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70770&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70770&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70770&r=support Expected behavior: https://bugs.php.net/fix.php?id=70770&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70770&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70770&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70770&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70770&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70770&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70770&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70770&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70770&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70770&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70770&r=mysqlcfg

« previous php.bugs (#196746) next »