3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Buzz { class A { public $foo; } } namespace Bar { use Buzz\A; class B { protected $a; public function __construct(new A) { $this->a = $a } public function show() { return $this->a; } } } $ bar = new \Bar\B(new \Buzz\A); echo $bar->show();
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected 'new' (T_NEW), expecting '&' or variable (T_VARIABLE) in /in/HkBDT on line 17
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_NEW, expecting '&' or T_VARIABLE in /in/HkBDT on line 17
Process exited with code 255.