3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 'fournisseurs_1331566668.csv' => array( 'name' => 'fournisseurs_1331566668.csv', 'date' => 1331566694 ), 'fournisseurs_1385460508.csv' => array( 'name' => 'fournisseurs_1385460508.csv', 'date' => 1385460517 ), 'fournisseurs_1334062493.csv' => array( 'name' => 'fournisseurs_1334062493.csv', 'date' => 1334062505 ), ); uasort($array, function($a, $b){ var_dump($a); if ($a['date'] == $a['date']) { return 0; } return ($a['date'] > $a['date']) ? +1 : -1; }); var_dump( $array );
Output for 7.0.0 - 7.1.0
array(2) { ["name"]=> string(27) "fournisseurs_1331566668.csv" ["date"]=> int(1331566694) } array(2) { ["name"]=> string(27) "fournisseurs_1385460508.csv" ["date"]=> int(1385460517) } array(3) { ["fournisseurs_1331566668.csv"]=> array(2) { ["name"]=> string(27) "fournisseurs_1331566668.csv" ["date"]=> int(1331566694) } ["fournisseurs_1385460508.csv"]=> array(2) { ["name"]=> string(27) "fournisseurs_1385460508.csv" ["date"]=> int(1385460517) } ["fournisseurs_1334062493.csv"]=> array(2) { ["name"]=> string(27) "fournisseurs_1334062493.csv" ["date"]=> int(1334062505) } }
Output for 5.3.0 - 5.6.28
array(2) { ["name"]=> string(27) "fournisseurs_1385460508.csv" ["date"]=> int(1385460517) } array(2) { ["name"]=> string(27) "fournisseurs_1334062493.csv" ["date"]=> int(1334062505) } array(3) { ["fournisseurs_1334062493.csv"]=> array(2) { ["name"]=> string(27) "fournisseurs_1334062493.csv" ["date"]=> int(1334062505) } ["fournisseurs_1385460508.csv"]=> array(2) { ["name"]=> string(27) "fournisseurs_1385460508.csv" ["date"]=> int(1385460517) } ["fournisseurs_1331566668.csv"]=> array(2) { ["name"]=> string(27) "fournisseurs_1331566668.csv" ["date"]=> int(1331566694) } }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/3aDDO on line 18
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/3aDDO on line 18
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3aDDO on line 18
Process exited with code 255.