Skip to content

Instantly share code, notes, and snippets.

@andersonfraga
Created February 8, 2013 16:36
Show Gist options
  • Save andersonfraga/4740178 to your computer and use it in GitHub Desktop.
Save andersonfraga/4740178 to your computer and use it in GitHub Desktop.
Segmentation fault using PHP 5.3.6 :/
<?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