Req #71054 [NEW]: arsort() function backward incompatible.

From: Date: Tue, 08 Dec 2015 08:37:08 +0000
Subject: Req #71054 [NEW]: arsort() function backward incompatible.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197677@lists.php.net to get a copy of this message
From: spongi1019 at naver dot com Operating system: CentOS 5.9 PHP version: 7.0.0 Package: Arrays related Bug Type: Feature/Change Request Bug description:arsort() function backward incompatible. Description: ------------ All the same, the value of element Non-compatible features have been found in the function. arsort() PHP 5.2 ~ 5.6 result ---- array(4) { ["d"]=> int(1) ["c"]=> int(1) ["z"]=> int(1) ["a"]=> int(1) } PHP 7.0 result ---- array(4) { ["a"]=> int(1) ["z"]=> int(1) ["c"]=> int(1) ["d"]=> int(1) } Test script: --------------- <?php $arr = array( 'a' => 1, 'z' => 1, 'c' => 1, 'd' => 1 ); arsort($arr); var_dump($arr); Expected result: ---------------- array(4) { ["d"]=> int(1) ["c"]=> int(1) ["z"]=> int(1) ["a"]=> int(1) } Actual result: -------------- array(4) { ["a"]=> int(1) ["z"]=> int(1) ["c"]=> int(1) ["d"]=> int(1) } -- Edit bug report at https://bugs.php.net/bug.php?id=71054&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71054&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71054&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71054&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71054&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71054&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71054&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71054&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71054&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71054&r=support Expected behavior: https://bugs.php.net/fix.php?id=71054&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71054&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71054&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71054&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71054&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71054&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71054&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71054&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71054&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71054&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71054&r=mysqlcfg

« previous php.bugs (#197677) next »