3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(0); debug_zval_dump($array); foreach ($array as $key => $value) { debug_zval_dump($array); }
Output for 7.1.0
array(1) refcount(3){ [0]=> int(0) } array(1) refcount(4){ [0]=> int(0) }
Output for 7.0.0 - 7.0.14
array(1) refcount(2){ [0]=> int(0) } array(1) refcount(3){ [0]=> int(0) }
Output for hhvm-3.12.0
array(1) refcount(1){ [0]=> long(0) refcount(1) } array(1) refcount(1){ [0]=> long(0) refcount(1) }
Output for hhvm-3.10.0
array(1) refcount(-127){ [0]=> long(0) refcount(1) } array(1) refcount(-127){ [0]=> long(0) refcount(1) }
Output for 5.4.0 - 5.6.28
array(1) refcount(2){ [0]=> long(0) refcount(1) } array(1) refcount(3){ [0]=> long(0) refcount(2) }
Output for 4.3.0 - 5.3.29
array(1) refcount(2){ [0]=> long(0) refcount(1) } array(1) refcount(4){ [0]=> long(0) refcount(2) }