3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Buzz { class A { public $foo = 'test Buzz'; } } namespace Bar { use Buzz\A; class B { protected $a; public function __construct(A $a) { $this->a = $a; } public function show() { return $this->a->foo; } } } $bar = new \Bar\B(new \Buzz\A); echo $bar->show();
Output for 5.3.0 - 5.4.20
Fatal error: No code may exist outside of namespace {} in /in/IGhBT on line 28
Process exited with code 255.