3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Foo/Exception.php: namespace Foo { class Exception extends \Exception {} } // Foo/Bar.php: namespace Foo { use Exception; class Bar { public static function baz() { return get_class(new Exception('Should be base Exception')); } } } namespace { var_dump(Foo\Bar::baz()); }
based on 0DB4Q
Output for hhvm-3.10.0 - 3.12.0
string(9) "Exception"
Output for 5.3.0 - 5.4.32
Fatal error: Cannot use Exception as Exception because the name is already in use in /in/7tHog on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/7tHog on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/7tHog on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/7tHog on line 4
Process exited with code 255.