3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class a { public function __call ($name,$arguments) { if ($name == 'getb') return new b; throw new Exception('error'); } abstract function p(); } class b extends a { public function p () { echo 123; } } $a = new a; $b = $a->getb(); $b->p();
based on OeHKN
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot instantiate abstract class a in /in/JCX1a:18 Stack trace: #0 {main} thrown in /in/JCX1a on line 18
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Fatal error: Cannot instantiate abstract class a in /in/JCX1a on line 18
Process exited with code 255.