3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { } $foo = new foo(); $foo->bar = 'baz'; $blah = $foo; $blah = 'bazbaz'; debug_zval_dump($foo); debug_zval_dump($blah);
Output for hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.1.1, 7.1.7
object(foo)#1 (1) refcount(2){ ["bar"]=> string(3) "baz" refcount(1) } string(6) "bazbaz" refcount(1)
Output for 7.1.2 - 7.1.6
object(foo)#1 (1) refcount(2){ ["bar"]=> string(3) "baz" refcount(2) } string(6) "bazbaz" refcount(3)
Output for 5.0.0 - 5.6.30
object(foo)#1 (1) refcount(2){ ["bar"]=> string(3) "baz" refcount(1) } string(6) "bazbaz" refcount(2)
Output for 4.3.0 - 4.4.9
object(foo)(1) refcount(2){ ["bar"]=> string(3) "baz" refcount(1) } string(6) "bazbaz" refcount(2)