3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); while(count($array) > 0){ $first = array_shift($array); foreach($array as $value){ $result[] = $array[0] + $value; } } var_dump($result);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(190) { [0]=> int(4) [1]=> int(5) [2]=> int(6) [3]=> int(7) [4]=> int(8) [5]=> int(9) [6]=> int(10) [7]=> int(11) [8]=> int(12) [9]=> int(13) [10]=> int(14) [11]=> int(15) [12]=> int(16) [13]=> int(17) [14]=> int(18) [15]=> int(19) [16]=> int(20) [17]=> int(21) [18]=> int(22) [19]=> int(6) [20]=> int(7) [21]=> int(8) [22]=> int(9) [23]=> int(10) [24]=> int(11) [25]=> int(12) [26]=> int(13) [27]=> int(14) [28]=> int(15) [29]=> int(16) [30]=> int(17) [31]=> int(18) [32]=> int(19) [33]=> int(20) [34]=> int(21) [35]=> int(22) [36]=> int(23) [37]=> int(8) [38]=> int(9) [39]=> int(10) [40]=> int(11) [41]=> int(12) [42]=> int(13) [43]=> int(14) [44]=> int(15) [45]=> int(16) [46]=> int(17) [47]=> int(18) [48]=> int(19) [49]=> int(20) [50]=> int(21) [51]=> int(22) [52]=> int(23) [53]=> int(24) [54]=> int(10) [55]=> int(11) [56]=> int(12) [57]=> int(13) [58]=> int(14) [59]=> int(15) [60]=> int(16) [61]=> int(17) [62]=> int(18) [63]=> int(19) [64]=> int(20) [65]=> int(21) [66]=> int(22) [67]=> int(23) [68]=> int(24) [69]=> int(25) [70]=> int(12) [71]=> int(13) [72]=> int(14) [73]=> int(15) [74]=> int(16) [75]=> int(17) [76]=> int(18) [77]=> int(19) [78]=> int(20) [79]=> int(21) [80]=> int(22) [81]=> int(23) [82]=> int(24) [83]=> int(25) [84]=> int(26) [85]=> int(14) [86]=> int(15) [87]=> int(16) [88]=> int(17) [89]=> int(18) [90]=> int(19) [91]=> int(20) [92]=> int(21) [93]=> int(22) [94]=> int(23) [95]=> int(24) [96]=> int(25) [97]=> int(26) [98]=> int(27) [99]=> int(16) [100]=> int(17) [101]=> int(18) [102]=> int(19) [103]=> int(20) [104]=> int(21) [105]=> int(22) [106]=> int(23) [107]=> int(24) [108]=> int(25) [109]=> int(26) [110]=> int(27) [111]=> int(28) [112]=> int(18) [113]=> int(19) [114]=> int(20) [115]=> int(21) [116]=> int(22) [117]=> int(23) [118]=> int(24) [119]=> int(25) [120]=> int(26) [121]=> int(27) [122]=> int(28) [123]=> int(29) [124]=> int(20) [125]=> int(21) [126]=> int(22) [127]=> int(23) [128]=> int(24) [129]=> int(25) [130]=> int(26) [131]=> int(27) [132]=> int(28) [133]=> int(29) [134]=> int(30) [135]=> int(22) [136]=> int(23) [137]=> int(24) [138]=> int(25) [139]=> int(26) [140]=> int(27) [141]=> int(28) [142]=> int(29) [143]=> int(30) [144]=> int(31) [145]=> int(24) [146]=> int(25) [147]=> int(26) [148]=> int(27) [149]=> int(28) [150]=> int(29) [151]=> int(30) [152]=> int(31) [153]=> int(32) [154]=> int(26) [155]=> int(27) [156]=> int(28) [157]=> int(29) [158]=> int(30) [159]=> int(31) [160]=> int(32) [161]=> int(33) [162]=> int(28) [163]=> int(29) [164]=> int(30) [165]=> int(31) [166]=> int(32) [167]=> int(33) [168]=> int(34) [169]=> int(30) [170]=> int(31) [171]=> int(32) [172]=> int(33) [173]=> int(34) [174]=> int(35) [175]=> int(32) [176]=> int(33) [177]=> int(34) [178]=> int(35) [179]=> int(36) [180]=> int(34) [181]=> int(35) [182]=> int(36) [183]=> int(37) [184]=> int(36) [185]=> int(37) [186]=> int(38) [187]=> int(38) [188]=> int(39) [189]=> int(40) }
Output for hhvm-3.10.0

Process exited with code 153.