3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function cmp($a, $b) { if ($a == $b) { return 0; } echo $b."mukesh"; return ($a < $b) ? -1 : 1; } $a = array(3, 2, 5, 6, 1); usort($a, "cmp"); foreach ($a as $key => $value) { echo "$key: $value\n"; }
based on UP90e
Output for 7.0.0 - 7.2.0
2mukesh2mukesh5mukesh6mukesh1mukesh1mukesh1mukesh1mukesh0: 1 1: 2 2: 3 3: 5 4: 6
Output for 5.3.20 - 5.6.28
2mukesh3mukesh6mukesh5mukesh1mukesh2mukesh0: 1 1: 2 2: 3 3: 5 4: 6