3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ConcreteBar { function test() { return "concrete"; } } class ApplicationBar { function test() { return "application"; } } class Foo extends Bar { } class_alias('ConcreteBar', 'Bar'); $foo = new Foo; var_dump($foo->test());
Output for 5.0.0 - 7.2.0
Fatal error: Class 'Bar' not found in /in/29DVp on line 20
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Class foo: Cannot inherit from undefined class bar in /in/29DVp on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Class foo: Cannot inherit from undefined class bar in /in/29DVp on line 20