3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public $bar; public $baz; } $a = new Foo(); $b = &$a; $a->bar = 42; $b->baz = 43; var_dump($a, $b);
Output for 5.5.0 - 7.3.0
object(Foo)#1 (2) { ["bar"]=> int(42) ["baz"]=> int(43) } object(Foo)#1 (2) { ["bar"]=> int(42) ["baz"]=> int(43) }