3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(10); reset($array); for ($i = 1; $i <= 60; $i++) { $array[] = current($array) + 1; next($array); } var_dump(array_sum($array), $array);
based on Echil
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
int(2440) array(61) { [0]=> int(10) [1]=> int(11) [2]=> int(12) [3]=> int(13) [4]=> int(14) [5]=> int(15) [6]=> int(16) [7]=> int(17) [8]=> int(18) [9]=> int(19) [10]=> int(20) [11]=> int(21) [12]=> int(22) [13]=> int(23) [14]=> int(24) [15]=> int(25) [16]=> int(26) [17]=> int(27) [18]=> int(28) [19]=> int(29) [20]=> int(30) [21]=> int(31) [22]=> int(32) [23]=> int(33) [24]=> int(34) [25]=> int(35) [26]=> int(36) [27]=> int(37) [28]=> int(38) [29]=> int(39) [30]=> int(40) [31]=> int(41) [32]=> int(42) [33]=> int(43) [34]=> int(44) [35]=> int(45) [36]=> int(46) [37]=> int(47) [38]=> int(48) [39]=> int(49) [40]=> int(50) [41]=> int(51) [42]=> int(52) [43]=> int(53) [44]=> int(54) [45]=> int(55) [46]=> int(56) [47]=> int(57) [48]=> int(58) [49]=> int(59) [50]=> int(60) [51]=> int(61) [52]=> int(62) [53]=> int(63) [54]=> int(64) [55]=> int(65) [56]=> int(66) [57]=> int(67) [58]=> int(68) [59]=> int(69) [60]=> int(70) }