3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Runnable { protected function __construct() { echo 'New runnable object has been created'.PHP_EOL; } } class Thread extends Runnable { protected function __construct() { echo 'New thread has been created'.PHP_EOL; } } $thread = new Thread();
based on sfb4f
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to protected Thread::__construct() from invalid context in /in/J1Kt1:12 Stack trace: #0 {main} thrown in /in/J1Kt1 on line 12
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Fatal error: Call to protected Thread::__construct() from invalid context in /in/J1Kt1 on line 12
Process exited with code 255.