3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public $bar = 'baz'; } class FooProxy extends Foo { private $wrapped; public function __construct(Foo $foo) { $this->wrapped = $foo; unset($this->bar); } public function & __get($name) { return $this->wrapped->$name; } public function __set($name, $value) { $this->wrapped->$name = $value; } public function __isset($name) { return isset($this->wrapped->$name); } public function __unset($name) { return unset($this->wrapped->$name); } } $foo = new FooProxy(new Foo()); $foo->bar; $foo->bar = 'baz'; isset($foo->bar); unset($foo->bar);
Output for 5.4.0 - 5.4.16
Parse error: syntax error, unexpected 'unset' (T_UNSET) in /in/5tiRc on line 34
Process exited with code 255.
Output for 5.3.0 - 5.3.24, 5.3.26
Parse error: syntax error, unexpected T_UNSET in /in/5tiRc on line 34
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected T_UNSET in /in/OdR0T on line 34
Process exited with code 255.