|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-12-08 10:31 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
[2015-12-08 10:31 UTC] laruence@php.net
[2015-12-08 14:46 UTC] rasmus@php.net
[2015-12-09 00:21 UTC] spongi1019 at naver dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
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) }