3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { } $foo = new foo(); $foo->bar = 'baz'; $blah = $foo; debug_zval_dump($foo); $blah->bar = 'bazbaz'; debug_zval_dump($foo); debug_zval_dump($blah);
Output for 5.0.0 - 7.1.0
object(foo)#1 (1) refcount(3){ ["bar"]=> string(3) "baz" refcount(1) } object(foo)#1 (1) refcount(3){ ["bar"]=> string(6) "bazbaz" refcount(1) } object(foo)#1 (1) refcount(3){ ["bar"]=> string(6) "bazbaz" refcount(1) }
Output for 4.3.0 - 4.4.9
object(foo)(1) refcount(3){ ["bar"]=> string(3) "baz" refcount(1) } object(foo)(1) refcount(2){ ["bar"]=> string(3) "baz" refcount(1) } object(foo)(1) refcount(2){ ["bar"]=> string(6) "bazbaz" refcount(1) }