3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php public function spin ($lambda, $wait = 60) { for ($i = 0; $i < $wait; $i++) { try { if ($lambda($this)) { return true; } } catch (Exception $e) { // do nothing } sleep(1); } $backtrace = debug_backtrace(); throw new Exception( "Timeout thrown by " . $backtrace[1]['class'] . "::" . $backtrace[1]['function'] . "()\n" . $backtrace[1]['file'] . ", line " . $backtrace[1]['line'] ); }
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /in/kVk7A on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_PUBLIC in /in/kVk7A on line 3
Process exited with code 255.