3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { new Animal(); } catch (\Error $e) { echo $e->getMessage(); } try { (new StdClass())->foo(); } catch (\Error $e) { echo $e->getMessage(); }
based on lXeQM
Output for 7.0.0 - 7.2.0
Class 'Animal' not foundCall to undefined method stdClass::foo()
Output for 5.4.10 - 5.6.28
Fatal error: Class 'Animal' not found in /in/1mhTv on line 4
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/1mhTv on line 10
Process exited with code 255.