3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace derp { class Foo {} } namespace herp { class BetterFoo extends Foo {} class Derp { public function __construct(DerpFoo $foo) {} } } class_alias('DerpFoo', '\derp\Foo'); $f = new \herp\Derp(new \herp\BetterFoo);
Output for 5.3.0 - 5.4.28
Fatal error: No code may exist outside of namespace {} in /in/sP1pB on line 21
Process exited with code 255.