3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class base { public static function factory() { return new self; } } final class concrete extends base { } var_dump(concrete::factory()); var_dump(base::factory());
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot instantiate abstract class base in /in/7bRFt:7 Stack trace: #0 /in/7bRFt(15): base::factory() #1 {main} thrown in /in/7bRFt on line 7
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Cannot instantiate abstract class base in /in/7bRFt on line 7
Process exited with code 255.