3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $std1 = new stdclass(); $std1->id = 0; $std2 = new stdclass(); $std2->id = 1; $previous = array($std1); $new = array($std1, $std2); function compareThem($a, $b) { $diff = $a->id - $b->id; if ($diff < 0) { return -1 } if ($diff > 0) { return 1; } return 0; }
Output for 5.3.0 - 5.4.21
Parse error: syntax error, unexpected '}' in /in/a8dP0 on line 16
Process exited with code 255.