3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array('foo' => 'bar'); debug_zval_dump($array); $copy = $array; debug_zval_dump($array); debug_zval_dump($copy); reset($copy); debug_zval_dump($array); debug_zval_dump($copy);
Output for 7.1.0 - 7.3.0rc3
array(1) refcount(3){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(4){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(4){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(3){ ["foo"]=> string(3) "bar" refcount(2) } array(1) refcount(2){ ["foo"]=> string(3) "bar" refcount(2) }
Output for 7.0.0 - 7.0.20
array(1) refcount(2){ ["foo"]=> string(3) "bar" refcount(2) } array(1) refcount(3){ ["foo"]=> string(3) "bar" refcount(2) } array(1) refcount(3){ ["foo"]=> string(3) "bar" refcount(2) } array(1) refcount(2){ ["foo"]=> string(3) "bar" refcount(3) } array(1) refcount(2){ ["foo"]=> string(3) "bar" refcount(3) }
Output for hhvm-3.15.4 - 3.17.3
array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(1) }
Output for hhvm-3.11.1 - 3.13.2
array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(-127) } array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(-127) } array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(-127) } array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(-127) } array(1) refcount(1){ ["foo"]=> string(3) "bar" refcount(-127) }
Output for hhvm-3.10.1
array(1) refcount(-127){ ["foo"]=> string(3) "bar" refcount(-127) } array(1) refcount(-127){ ["foo"]=> string(3) "bar" refcount(-127) } array(1) refcount(-127){ ["foo"]=> string(3) "bar" refcount(-127) } array(1) refcount(-127){ ["foo"]=> string(3) "bar" refcount(-127) } array(1) refcount(-127){ ["foo"]=> string(3) "bar" refcount(-127) }
Output for 4.3.0 - 5.6.30
array(1) refcount(2){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(3){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(3){ ["foo"]=> string(3) "bar" refcount(1) } array(1) refcount(2){ ["foo"]=> string(3) "bar" refcount(2) } array(1) refcount(2){ ["foo"]=> string(3) "bar" refcount(2) }