3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr1 = [1,2,3]; $arr2 = $arr1; debug_zval_dump($arr2); key($arr2); debug_zval_dump($arr2); unset($arr1); unset($arr2); $arr1 = [1,2,3]; $arr2 = $arr1; debug_zval_dump($arr2); end($arr2); debug_zval_dump($arr2);
based on WuQoe
Output for 7.1.0 - 7.2.0
array(3) refcount(4){ [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) refcount(4){ [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) refcount(4){ [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) refcount(2){ [0]=> int(1) [1]=> int(2) [2]=> int(3) }
Output for 7.0.0 - 7.0.20
array(3) refcount(3){ [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) refcount(3){ [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) refcount(3){ [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) refcount(2){ [0]=> int(1) [1]=> int(2) [2]=> int(3) }
Output for 5.4.0 - 5.6.28
array(3) refcount(3){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1) [2]=> long(3) refcount(1) } array(3) refcount(2){ [0]=> long(1) refcount(2) [1]=> long(2) refcount(2) [2]=> long(3) refcount(2) } array(3) refcount(3){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1) [2]=> long(3) refcount(1) } array(3) refcount(2){ [0]=> long(1) refcount(2) [1]=> long(2) refcount(2) [2]=> long(3) refcount(2) }
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/qieJ4 on line 2
Process exited with code 255.