3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a() { $myArray = array(); $myArray[1] = array(1,2,3,4,5,6,7,8,9,10); $myArray[2] = array(1,2,3,4,5,6,7,8,9,10); $myArray[3] = array(1,2,3,4,5,6,7,8,9,10); debug_zval_dump($myArray[1]); } function b() { $myArray = array(); $myArray[1] = array(1,2,3); $myArray[2] = array(1,2,3); $myArray[3] = array(1,2,3); $myArray[4] = array(1,2,3); $myArray[5] = array(1,2,3); $myArray[6] = array(1,2,3); $myArray[7] = array(1,2,3); $myArray[8] = array(1,2,3); $myArray[9] = array(1,2,3); $myArray[10] = array(1,2,3); debug_zval_dump($myArray[1]); } a();b();
based on rZkTf
Output for 7.1.0 - 7.2.0
array(10) refcount(3){ [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } array(3) refcount(3){ [0]=> int(1) [1]=> int(2) [2]=> int(3) }
Output for 7.0.0 - 7.0.20
array(10) refcount(2){ [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } array(3) refcount(2){ [0]=> int(1) [1]=> int(2) [2]=> int(3) }
Output for 5.3.22 - 5.6.28
array(10) refcount(2){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1) [2]=> long(3) refcount(1) [3]=> long(4) refcount(1) [4]=> long(5) refcount(1) [5]=> long(6) refcount(1) [6]=> long(7) refcount(1) [7]=> long(8) refcount(1) [8]=> long(9) refcount(1) [9]=> long(10) refcount(1) } array(3) refcount(2){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1) [2]=> long(3) refcount(1) }