3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Lock { public function __construct() { echo "lock" . PHP_EOL; } public function unlock() { echo "unlock" . PHP_EOL; } } $lock = new Lock(); $nullObject = null; try { $nullObject->undefined(); } catch(Exception $e) { } finally { $lock->unlock(); }
based on 4gsc3
Output for 7.0.0 - 7.2.0
lock unlock Fatal error: Uncaught Error: Call to a member function undefined() on null in /in/HpZXu:21 Stack trace: #0 {main} thrown in /in/HpZXu on line 21
Process exited with code 255.
Output for 5.6.7 - 5.6.21
lock Fatal error: Call to a member function undefined() on null in /in/HpZXu on line 21
Process exited with code 255.
Output for 5.5.24 - 5.5.35
lock Fatal error: Call to a member function undefined() on a non-object in /in/HpZXu on line 21
Process exited with code 255.
Output for 5.3.18 - 5.4.45
Parse error: syntax error, unexpected '{' in /in/HpZXu on line 24
Process exited with code 255.