Created
February 8, 2013 16:36
-
-
Save andersonfraga/4740178 to your computer and use it in GitHub Desktop.
Segmentation fault using PHP 5.3.6 :/
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 | |
$list = array( | |
array( | |
'idCliente' => 12, | |
), | |
array( | |
'idCliente' => 2, | |
), | |
array( | |
'idCliente' => 8, | |
), | |
array( | |
'idCliente' => 20, | |
), | |
array( | |
'idCliente' => 2, | |
), | |
array( | |
'idCliente' => 65, | |
), | |
array( | |
'idCliente' => 75, | |
), | |
array( | |
'idCliente' => 7, | |
), | |
); | |
uksort($list, function($a, $b) use($list) { | |
if ($list[$a]['idCliente'] == $list[$b]['idCliente']) { | |
return 0; | |
} | |
return ($list[$a]['idCliente'] > $list[$b]['idCliente']) ? 1 : -1; | |
}); | |
echo '<pre>'; | |
print_r($list); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment