3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class x { public function __construct() { $x =& $this; $x = new stdClass; var_dump($this); } public function test() { $x =& $this; $x = new stdClass; var_dump($this); } } $a = new x; var_dump($a); $a->test();
based on USqeb
Output for 7.1.0 - 7.2.0
object(x)#1 (0) { } object(x)#1 (0) { } object(x)#1 (0) { }
Output for 5.3.17 - 7.0.20
object(stdClass)#2 (0) { } object(x)#1 (0) { } object(stdClass)#2 (0) { }