| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2015-06-18 05:42 UTC] requinix@php.net
 
-Status: Open
+Status: Not a bug
  [2015-06-18 05:42 UTC] requinix@php.net
  [2015-06-18 06:09 UTC] dmifedorenko at gmail dot com
  [2015-06-18 06:52 UTC] requinix@php.net
  [2015-06-18 08:04 UTC] nikic@php.net
  | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 00:00:01 2025 UTC | 
Description: ------------ Different usort behavior in php5.6 and php7. 5.6 returns first array element, and 7 returns last element. Test script: --------------- $results = array( array(2001, 1), array(2002, 1), ); usort($results, function ($a, $b) { return $a[1] > $b[1] ? -1 : 1; }); var_dump($results[0][0]); Expected result: ---------------- int(2001) Actual result: -------------- int(2002)