Last active
March 23, 2017 07:50
-
-
Save nook24/8a0ee7c8007ce554b7b59d9550e28f1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = [ | |
1 => ['' => 'Foobar'], | |
2 => ['Bar'], | |
3 => ['Foo'] | |
]; | |
$assertedOutput = [ | |
0 => ['Foo'], | |
1 => ['Bar'], | |
2 => ['' => 'Foobar'] | |
]; | |
rsort($a); | |
print_r($a); | |
?> | |
/****** PHP 5.5.9-1ubuntu4.21 *******/ | |
Array | |
( | |
[0] => Array | |
( | |
[0] => Foo | |
) | |
[1] => Array | |
( | |
[0] => Bar | |
) | |
[2] => Array | |
( | |
[] => Foobar | |
) | |
) | |
/****** PHP 7.0.15-0ubuntu0.16.04.4 *******/ | |
Array | |
( | |
[0] => Array | |
( | |
[] => Foobar | |
) | |
[1] => Array | |
( | |
[0] => Foo | |
) | |
[2] => Array | |
( | |
[0] => Bar | |
) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment