3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { protected $bar; public function &__get($property) { return $this->bar; } public function __set($property, &$value) { $this->bar = &$value; } } $test = new Foo; $a = 0; $test->bar = $a; $a++; echo $test->bar;
Output for 5.3.0 - 5.4.21
Fatal error: Method Foo::__set() cannot take arguments by reference in /in/HQX0E on line 14
Process exited with code 255.