3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function cmp($a, $b) { if ($a == $b) { return 0; } try { throw new Exception(); } catch (Exception $E) { } return ($a < $b) ? -1 : 1; } $a = array(3, 2, 5, 6, 1); usort($a, "cmp");
Output for 5.0.0 - 5.2.10, 5.3.0, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Output for 5.2.11 - 5.2.17, 5.3.1 - 5.6.28
Warning: usort(): Array was modified by the user comparison function in /in/tHdSH on line 19
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/tHdSH on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/tHdSH on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/tHdSH on line 8
Process exited with code 255.