3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?phpclass Foo{ private $var; public function buggy() { $bar = new Bar; $bar->prop = & $this->var; $bar->run(); var_dump($this->var); }}class Bar{ public $prop = 'init'; public function run() { $this->prop .= 'xxx'; }}(new Foo)->buggy();
Output for 5.4.0 - 5.4.32
<?phpclass Foo{ private $var; public function buggy() { $bar = new Bar; $bar->prop = & $this->var; $bar->run(); var_dump($this->var); }}class Bar{ public $prop = 'init'; public function run() { $this->prop .= 'xxx'; }}(new Foo)->buggy();