3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Lock { public function __construct() { echo "lock" . PHPEOL; } public function __destruct() { echo "unlock" . PHPEOL; } } new Lock(); $nullObject = null; try { $nullObject->undefined(); } catch(Exception $e) { }
Output for 7.2.0
Warning: Use of undefined constant PHPEOL - assumed 'PHPEOL' (this will throw an Error in a future version of PHP) in /in/HsSh9 on line 7 lockPHPEOL Warning: Use of undefined constant PHPEOL - assumed 'PHPEOL' (this will throw an Error in a future version of PHP) in /in/HsSh9 on line 12 unlockPHPEOL Fatal error: Uncaught Error: Call to a member function undefined() on null in /in/HsSh9:21 Stack trace: #0 {main} thrown in /in/HsSh9 on line 21
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant PHPEOL - assumed 'PHPEOL' in /in/HsSh9 on line 7 lockPHPEOL Notice: Use of undefined constant PHPEOL - assumed 'PHPEOL' in /in/HsSh9 on line 12 unlockPHPEOL Fatal error: Uncaught Error: Call to a member function undefined() on null in /in/HsSh9:21 Stack trace: #0 {main} thrown in /in/HsSh9 on line 21
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Notice: Use of undefined constant PHPEOL - assumed 'PHPEOL' in /in/HsSh9 on line 7 lockPHPEOL Notice: Use of undefined constant PHPEOL - assumed 'PHPEOL' in /in/HsSh9 on line 12 unlockPHPEOL Fatal error: Call to a member function undefined() on null in /in/HsSh9 on line 21
Process exited with code 255.
Output for 5.3.18 - 5.5.35
Notice: Use of undefined constant PHPEOL - assumed 'PHPEOL' in /in/HsSh9 on line 7 lockPHPEOL Notice: Use of undefined constant PHPEOL - assumed 'PHPEOL' in /in/HsSh9 on line 12 unlockPHPEOL Fatal error: Call to a member function undefined() on a non-object in /in/HsSh9 on line 21
Process exited with code 255.