3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 23; $b = 2; $res = 1; $arr = null; for($i = $a; $res > 0; $i = $res) { $arr[] = $i % $b; // store remainder in array $res = $i / $b; } var_dump($arr);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1080) { [0]=> int(1) [1]=> int(1) [2]=> int(1) [3]=> int(0) [4]=> int(1) [5]=> int(0) [6]=> int(0) [7]=> int(0) [8]=> int(0) [9]=> int(0) [10]=> int(0) [11]=> int(0) [12]=> int(0) [13]=> int(0) [14]=> int(0) [15]=> int(0) [16]=> int(0) [17]=> int(0) [18]=> int(0) [19]=> int(0) [20]=> int(0) [21]=> int(0) [22]=> int(0) [23]=> int(0) [24]=> int(0) [25]=> int(0) [26]=> int(0) [27]=> int(0) [28]=> int(0) [29]=> int(0) [30]=> int(0) [31]=> int(0) [32]=> int(0) [33]=> int(0) [34]=> int(0) [35]=> int(0) [36]=> int(0) [37]=> int(0) [38]=> int(0) [39]=> int(0) [40]=> int(0) [41]=> int(0) [42]=> int(0) [43]=> int(0) [44]=> int(0) [45]=> int(0) [46]=> int(0) [47]=> int(0) [48]=> int(0) [49]=> int(0) [50]=> int(0) [51]=> int(0) [52]=> int(0) [53]=> int(0) [54]=> int(0) [55]=> int(0) [56]=> int(0) [57]=> int(0) [58]=> int(0) [59]=> int(0) [60]=> int(0) [61]=> int(0) [62]=> int(0) [63]=> int(0) [64]=> int(0) [65]=> int(0) [66]=> int(0) [67]=> int(0) [68]=> int(0) [69]=> int(0) [70]=> int(0) [71]=> int(0) [72]=> int(0) [73]=> int(0) [74]=> int(0) [75]=> int(0) [76]=> int(0) [77]=> int(0) [78]=> int(0) [79]=> int(0) [80]=> int(0) [81]=> int(0) [82]=> int(0) [83]=> int(0) [84]=> int(0) [85]=> int(0) [86]=> int(0) [87]=> int(0) [88]=> int(0) [89]=> int(0) [90]=> int(0) [91]=> int(0) [92]=> int(0) [93]=> int(0) [94]=> int(0) [95]=> int(0) [96]=> int(0) [97]=> int(0) [98]=> int(0) [99]=> int(0) [100]=> int(0) [101]=> int(0) [102]=> int(0) [103]=> int(0) [104]=> int(0) [105]=> int(0) [106]=> int(0) [107]=> int(0) [108]=> int(0) [109]=> int(0) [110]=> int(0) [111]=> int(0) [112]=> int(0) [113]=> int(0) [114]=> int(0) [115]=> int(0) [116]=> int(0) [117]=> int(0) [118]=> int(0) [119]=> int(0) [120]=> int(0) [121]=> int(0) [122]=> int(0) [123]=> int(0) [124]=> int(0) [125]=> int(0) [126]=> int(0) [127]=> int(0) [128]=> int(0) [129]=> int(0) [130]=> int(0) [131]=> int(0) [132]=> int(0) [133]=> int(0) [134]=> int(0) [135]=> int(0) [136]=> int(0) [137]=> int(0) [138]=> int(0) [139]=> int(0) [140]=> int(0) [141]=> int(0) [142]=> int(0) [143]=> int(0) [144]=> int(0) [145]=> int(0) [146]=> int(0) [147]=> int(0) [148]=> int(0) [149]=> int(0) [150]=> int(0) [151]=> int(0) [152]=> int(0) [153]=> int(0) [154]=> int(0) [155]=> int(0) [156]=> int(0) [157]=> int(0) [158]=> int(0) [159]=> int(0) [160]=> int(0) [161]=> int(0) [162]=> int(0) [163]=> int(0) [164]=> int(0) [165]=> int(0) [166]=> int(0) [167]=> int(0) [168]=> int(0) [169]=> int(0) [170]=> int(0) [171]=> int(0) [172]=> int(0) [173]=> int(0) [174]=> int(0) [175]=> int(0) [176]=> int(0) [177]=> int(0) [178]=> int(0) [179]=> int(0) [180]=> int(0) [181]=> int(0) [182]=> int(0) [183]=> int(0) [184]=> int(0) [185]=> int(0) [186]=> int(0) [187]=> int(0) [188]=> int(0) [189]=> int(0) [190]=> int(0) [191]=> int(0) [192]=> int(0) [193]=> int(0) [194]=> int(0) [195]=> int(0) [196]=> int(0) [197]=> int(0) [198]=> int(0) [199]=> int(0) [200]=> int(0) [201]=> int(0) [202]=> int(0) [203]=> int(0) [204]=> int(0) [205]=> int(0) [206]=> int(0) [207]=> int(0) [208]=> int(0) [209]=> int(0) [210]=> int(0) [211]=> int(0) [212]=> int(0) [213]=> int(0) [214]=> int(0) [215]=> int(0) [216]=> int(0) [217]=> int(0) [218]=> int(0) [219]=> int(0) [220]=> int(0) [221]=> int(0) [222]=> int(0) [223]=> int(0) [224]=> int(0) [225]=> int(0) [226]=> int(0) [227]=> int(0) [228]=> int(0) [229]=> int(0) [230]=> int(0) [231]=> int(0) [232]=> int(0) [233]=> int(0) [234]=> int(0) [235]=> int(0) [236]=> int(0) [237]=> int(0) [238]=> int(0) [239]=> int(0) [240]=> int(0) [241]=> int(0) [242]=> int(0) [243]=> int(0) [244]=> int(0) [245]=> int(0) [246]=> int(0) [247]=> int(0) [248]=> int(0) [249]=> int(0) [250]=> int(0) [251]=> int(0) [252]=> int(0) [253]=> int(0) [254]=> int(0) [255]=> int(0) [256]=> int(0) [257]=> int(0) [258]=> int(0) [259]=> int(0) [260]=> int(0) [261]=> int(0) [262]=> int(0) [263]=> int(0) [264]=> int(0) [265]=> int(0) [266]=> int(0) [267]=> int(0) [268]=> int(0) [269]=> int(0) [270]=> int(0) [271]=> int(0) [272]=> int(0) [273]=> int(0) [274]=> int(0) [275]=> int(0) [276]=> int(0) [277]=> int(0) [278]=> int(0) [279]=> int(0) [280]=> int(0) [281]=> int(0) [282]=> int(0) [283]=> int(0) [284]=> int(0) [285]=> int(0) [286]=> int(0) [287]=> int(0) [288]=> int(0) [289]=> int(0) [290]=> int(0) [291]=> int(0) [292]=> int(0) [293]=> int(0) [294]=> int(0) [295]=> int(0) [296]=> int(0) [297]=> int(0) [298]=> int(0) [299]=> int(0) [300]=> int(0) [301]=> int(0) [302]=> int(0) [303]=> int(0) [304]=> int(0) [305]=> int(0) [306]=> int(0) [307]=> int(0) [308]=> int(0) [309]=> int(0) [310]=> int(0) [311]=> int(0) [312]=> int(0) [313]=> int(0) [314]=> int(0) [315]=> int(0) [316]=> int(0) [317]=> int(0) [318]=> int(0) [319]=> int(0) [320]=> int(0) [321]=> int(0) [322]=> int(0) [323]=> int(0) [324]=> int(0) [325]=> int(0) [326]=> int(0) [327]=> int(0) [328]=> int(0) [329]=> int(0) [330]=> int(0) [331]=> int(0) [332]=> int(0) [333]=> int(0) [334]=> int(0) [335]=> int(0) [336]=> int(0) [337]=> int(0) [338]=> int(0) [339]=> int(0) [340]=> int(0) [341]=> int(0) [342]=> int(0) [343]=> int(0) [344]=> int(0) [345]=> int(0) [346]=> int(0) [347]=> int(0) [348]=> int(0) [349]=> int(0) [350]=> int(0) [351]=> int(0) [352]=> int(0) [353]=> int(0) [354]=> int(0) [355]=> int(0) [356]=> int(0) [357]=> int(0) [358]=> int(0) [359]=> int(0) [360]=> int(0) [361]=> int(0) [362]=> int(0) [363]=> int(0) [364]=> int(0) [365]=> int(0) [366]=> int(0) [367]=> int(0) [368]=> int(0) [369]=> int(0) [370]=> int(0) [371]=> int(0) [372]=> int(0) [373]=> int(0) [374]=> int(0) [375]=> int(0) [376]=> int(0) [377]=> int(0) [378]=> int(0) [379]=> int(0) [380]=> int(0) [381]=> int(0) [382]=> int(0) [383]=> int(0) [384]=> int(0) [385]=> int(0) [386]=> int(0) [387]=> int(0) [388]=> int(0) [389]=> int(0) [390]=> int(0) [391]=> int(0) [392]=> int(0) [393]=> int(0) [394]=> int(0) [395]=> int(0) [396]=> int(0) [397]=> int(0) [398]=> int(0) [399]=> int(0) [400]=> int(0) [401]=> int(0) [402]=> int(0) [403]=> int(0) [404]=> int(0) [405]=> int(0) [406]=> int(0) [407]=> int(0) [408]=> int(0) [409]=> int(0) [410]=> int(0) [411]=> int(0) [412]=> int(0) [413]=> int(0) [414]=> int(0) [415]=> int(0) [416]=> int(0) [417]=> int(0) [418]=> int(0) [419]=> int(0) [420]=> int(0) [421]=> int(0) [422]=> int(0) [423]=> int(0) [424]=> int(0) [425]=> int(0) [426]=> int(0) [427]=> int(0) [428]=> int(0) [429]=> int(0) [430]=> int(0) [431]=> int(0) [432]=> int(0) [433]=> int(0) [434]=> int(0) [435]=> int(0) [436]=> int(0) [437]=> int(0) [438]=> int(0) [439]=> int(0) [440]=> int(0) [441]=> int(0) [442]=> int(0) [443]=> int(0) [444]=> int(0) [445]=> int(0) [446]=> int(0) [447]=> int(0) [448]=> int(0) [449]=> int(0) [450]=> int(0) [451]=> int(0) [452]=> int(0) [453]=> int(0) [454]=> int(0) [455]=> int(0) [456]=> int(0) [457]=> int(0) [458]=> int(0) [459]=> int(0) [460]=> int(0) [461]=> int(0) [462]=> int(0) [463]=> int(0) [464]=> int(0) [465]=> int(0) [466]=> int(0) [467]=> int(0) [468]=> int(0) [469]=> int(0) [470]=> int(0) [471]=> int(0) [472]=> int(0) [473]=> int(0) [474]=> int(0) [475]=> int(0) [476]=> int(0) [477]=> int(0) [478]=> int(0) [479]=> int(0) [480]=> int(0) [481]=> int(0) [482]=> int(0) [483]=> int(0) [484]=> int(0) [485]=> int(0) [486]=> int(0) [487]=> int(0) [488]=> int(0) [489]=> int(0) [490]=> int(0) [491]=> int(0) [492]=> int(0) [493]=> int(0) [494]=> int(0) [495]=> int(0) [496]=> int(0) [497]=> int(0) [498]=> int(0) [499]=> int(0) [500]=> int(0) [501]=> int(0) [502]=> int(0) [503]=> int(0) [504]=> int(0) [505]=> int(0) [506]=> int(0) [507]=> int(0) [508]=> int(0) [509]=> int(0) [510]=> int(0) [511]=> int(0) [512]=> int(0) [513]=> int(0) [514]=> int(0) [515]=> int(0) [516]=> int(0) [517]=> int(0) [518]=> int(0) [519]=> int(0) [520]=> int(0) [521]=> int(0) [522]=> int(0) [523]=> int(0) [524]=> int(0) [525]=> int(0) [526]=> int(0) [527]=> int(0) [528]=> int(0) [529]=> int(0) [530]=> int(0) [531]=> int(0) [532]=> int(0) [533]=> int(0) [534]=> int(0) [535]=> int(0) [536]=> int(0) [537]=> int(0) [538]=> int(0) [539]=> int(0) [540]=> int(0) [541]=> int(0) [542]=> int(0) [543]=> int(0) [544]=> int(0) [545]=> int(0) [546]=> int(0) [547]=> int(0) [548]=> int(0) [549]=> int(0) [550]=> int(0) [551]=> int(0) [552]=> int(0) [553]=> int(0) [554]=> int(0) [555]=> int(0) [556]=> int(0) [557]=> int(0) [558]=> int(0) [559]=> int(0) [560]=> int(0) [561]=> int(0) [562]=> int(0) [563]=> int(0) [564]=> int(0) [565]=> int(0) [566]=> int(0) [567]=> int(0) [568]=> int(0) [569]=> int(0) [570]=> int(0) [571]=> int(0) [572]=> int(0) [573]=> int(0) [574]=> int(0) [575]=> int(0) [576]=> int(0) [577]=> int(0) [578]=> int(0) [579]=> int(0) [580]=> int(0) [581]=> int(0) [582]=> int(0) [583]=> int(0) [584]=> int(0) [585]=> int(0) [586]=> int(0) [587]=> int(0) [588]=> int(0) [589]=> int(0) [590]=> int(0) [591]=> int(0) [592]=> int(0) [593]=> int(0) [594]=> int(0) [595]=> int(0) [596]=> int(0) [597]=> int(0) [598]=> int(0) [599]=> int(0) [600]=> int(0) [601]=> int(0) [602]=> int(0) [603]=> int(0) [604]=> int(0) [605]=> int(0) [606]=> int(0) [607]=> int(0) [608]=> int(0) [609]=> int(0) [610]=> int(0) [611]=> int(0) [612]=> int(0) [613]=> int(0) [614]=> int(0) [615]=> int(0) [616]=> int(0) [617]=> int(0) [618]=> int(0) [619]=> int(0) [620]=> int(0) [621]=> int(0) [622]=> int(0) [623]=> int(0) [624]=> int(0) [625]=> int(0) [626]=> int(0) [627]=> int(0) [628]=> int(0) [629]=> int(0) [630]=> int(0) [631]=> int(0) [632]=> int(0) [633]=> int(0) [634]=> int(0) [635]=> int(0) [636]=> int(0) [637]=> int(0) [638]=> int(0) [639]=> int(0) [640]=> int(0) [641]=> int(0) [642]=> int(0) [643]=> int(0) [644]=> int(0) [645]=> int(0) [646]=> int(0) [647]=> int(0) [648]=> int(0) [649]=> int(0) [650]=> int(0) [651]=> int(0) [652]=> int(0) [653]=> int(0) [654]=> int(0) [655]=> int(0) [656]=> int(0) [657]=> int(0) [658]=> int(0) [659]=> int(0) [660]=> int(0) [661]=> int(0) [662]=> int(0) [663]=> int(0) [664]=> int(0) [665]=> int(0) [666]=> int(0) [667]=> int(0) [668]=> int(0) [669]=> int(0) [670]=> int(0) [671]=> int(0) [672]=> int(0) [673]=> int(0) [674]=> int(0) [675]=> int(0) [676]=> int(0) [677]=> int(0) [678]=> int(0) [679]=> int(0) [680]=> int(0) [681]=> int(0) [682]=> int(0) [683]=> int(0) [684]=> int(0) [685]=> int(0) [686]=> int(0) [687]=> int(0) [688]=> int(0) [689]=> int(0) [690]=> int(0) [691]=> int(0) [692]=> int(0) [693]=> int(0) [694]=> int(0) [695]=> int(0) [696]=> int(0) [697]=> int(0) [698]=> int(0) [699]=> int(0) [700]=> int(0) [701]=> int(0) [702]=> int(0) [703]=> int(0) [704]=> int(0) [705]=> int(0) [706]=> int(0) [707]=> int(0) [708]=> int(0) [709]=> int(0) [710]=> int(0) [711]=> int(0) [712]=> int(0) [713]=> int(0) [714]=> int(0) [715]=> int(0) [716]=> int(0) [717]=> int(0) [718]=> int(0) [719]=> int(0) [720]=> int(0) [721]=> int(0) [722]=> int(0) [723]=> int(0) [724]=> int(0) [725]=> int(0) [726]=> int(0) [727]=> int(0) [728]=> int(0) [729]=> int(0) [730]=> int(0) [731]=> int(0) [732]=> int(0) [733]=> int(0) [734]=> int(0) [735]=> int(0) [736]=> int(0) [737]=> int(0) [738]=> int(0) [739]=> int(0) [740]=> int(0) [741]=> int(0) [742]=> int(0) [743]=> int(0) [744]=> int(0) [745]=> int(0) [746]=> int(0) [747]=> int(0) [748]=> int(0) [749]=> int(0) [750]=> int(0) [751]=> int(0) [752]=> int(0) [753]=> int(0) [754]=> int(0) [755]=> int(0) [756]=> int(0) [757]=> int(0) [758]=> int(0) [759]=> int(0) [760]=> int(0) [761]=> int(0) [762]=> int(0) [763]=> int(0) [764]=> int(0) [765]=> int(0) [766]=> int(0) [767]=> int(0) [768]=> int(0) [769]=> int(0) [770]=> int(0) [771]=> int(0) [772]=> int(0) [773]=> int(0) [774]=> int(0) [775]=> int(0) [776]=> int(0) [777]=> int(0) [778]=> int(0) [779]=> int(0) [780]=> int(0) [781]=> int(0) [782]=> int(0) [783]=> int(0) [784]=> int(0) [785]=> int(0) [786]=> int(0) [787]=> int(0) [788]=> int(0) [789]=> int(0) [790]=> int(0) [791]=> int(0) [792]=> int(0) [793]=> int(0) [794]=> int(0) [795]=> int(0) [796]=> int(0) [797]=> int(0) [798]=> int(0) [799]=> int(0) [800]=> int(0) [801]=> int(0) [802]=> int(0) [803]=> int(0) [804]=> int(0) [805]=> int(0) [806]=> int(0) [807]=> int(0) [808]=> int(0) [809]=> int(0) [810]=> int(0) [811]=> int(0) [812]=> int(0) [813]=> int(0) [814]=> int(0) [815]=> int(0) [816]=> int(0) [817]=> int(0) [818]=> int(0) [819]=> int(0) [820]=> int(0) [821]=> int(0) [822]=> int(0) [823]=> int(0) [824]=> int(0) [825]=> int(0) [826]=> int(0) [827]=> int(0) [828]=> int(0) [829]=> int(0) [830]=> int(0) [831]=> int(0) [832]=> int(0) [833]=> int(0) [834]=> int(0) [835]=> int(0) [836]=> int(0) [837]=> int(0) [838]=> int(0) [839]=> int(0) [840]=> int(0) [841]=> int(0) [842]=> int(0) [843]=> int(0) [844]=> int(0) [845]=> int(0) [846]=> int(0) [847]=> int(0) [848]=> int(0) [849]=> int(0) [850]=> int(0) [851]=> int(0) [852]=> int(0) [853]=> int(0) [854]=> int(0) [855]=> int(0) [856]=> int(0) [857]=> int(0) [858]=> int(0) [859]=> int(0) [860]=> int(0) [861]=> int(0) [862]=> int(0) [863]=> int(0) [864]=> int(0) [865]=> int(0) [866]=> int(0) [867]=> int(0) [868]=> int(0) [869]=> int(0) [870]=> int(0) [871]=> int(0) [872]=> int(0) [873]=> int(0) [874]=> int(0) [875]=> int(0) [876]=> int(0) [877]=> int(0) [878]=> int(0) [879]=> int(0) [880]=> int(0) [881]=> int(0) [882]=> int(0) [883]=> int(0) [884]=> int(0) [885]=> int(0) [886]=> int(0) [887]=> int(0) [888]=> int(0) [889]=> int(0) [890]=> int(0) [891]=> int(0) [892]=> int(0) [893]=> int(0) [894]=> int(0) [895]=> int(0) [896]=> int(0) [897]=> int(0) [898]=> int(0) [899]=> int(0) [900]=> int(0) [901]=> int(0) [902]=> int(0) [903]=> int(0) [904]=> int(0) [905]=> int(0) [906]=> int(0) [907]=> int(0) [908]=> int(0) [909]=> int(0) [910]=> int(0) [911]=> int(0) [912]=> int(0) [913]=> int(0) [914]=> int(0) [915]=> int(0) [916]=> int(0) [917]=> int(0) [918]=> int(0) [919]=> int(0) [920]=> int(0) [921]=> int(0) [922]=> int(0) [923]=> int(0) [924]=> int(0) [925]=> int(0) [926]=> int(0) [927]=> int(0) [928]=> int(0) [929]=> int(0) [930]=> int(0) [931]=> int(0) [932]=> int(0) [933]=> int(0) [934]=> int(0) [935]=> int(0) [936]=> int(0) [937]=> int(0) [938]=> int(0) [939]=> int(0) [940]=> int(0) [941]=> int(0) [942]=> int(0) [943]=> int(0) [944]=> int(0) [945]=> int(0) [946]=> int(0) [947]=> int(0) [948]=> int(0) [949]=> int(0) [950]=> int(0) [951]=> int(0) [952]=> int(0) [953]=> int(0) [954]=> int(0) [955]=> int(0) [956]=> int(0) [957]=> int(0) [958]=> int(0) [959]=> int(0) [960]=> int(0) [961]=> int(0) [962]=> int(0) [963]=> int(0) [964]=> int(0) [965]=> int(0) [966]=> int(0) [967]=> int(0) [968]=> int(0) [969]=> int(0) [970]=> int(0) [971]=> int(0) [972]=> int(0) [973]=> int(0) [974]=> int(0) [975]=> int(0) [976]=> int(0) [977]=> int(0) [978]=> int(0) [979]=> int(0) [980]=> int(0) [981]=> int(0) [982]=> int(0) [983]=> int(0) [984]=> int(0) [985]=> int(0) [986]=> int(0) [987]=> int(0) [988]=> int(0) [989]=> int(0) [990]=> int(0) [991]=> int(0) [992]=> int(0) [993]=> int(0) [994]=> int(0) [995]=> int(0) [996]=> int(0) [997]=> int(0) [998]=> int(0) [999]=> int(0) [1000]=> int(0) [1001]=> int(0) [1002]=> int(0) [1003]=> int(0) [1004]=> int(0) [1005]=> int(0) [1006]=> int(0) [1007]=> int(0) [1008]=> int(0) [1009]=> int(0) [1010]=> int(0) [1011]=> int(0) [1012]=> int(0) [1013]=> int(0) [1014]=> int(0) [1015]=> int(0) [1016]=> int(0) [1017]=> int(0) [1018]=> int(0) [1019]=> int(0) [1020]=> int(0) [1021]=> int(0) [1022]=> int(0) [1023]=> int(0) [1024]=> int(0) [1025]=> int(0) [1026]=> int(0) [1027]=> int(0) [1028]=> int(0) [1029]=> int(0) [1030]=> int(0) [1031]=> int(0) [1032]=> int(0) [1033]=> int(0) [1034]=> int(0) [1035]=> int(0) [1036]=> int(0) [1037]=> int(0) [1038]=> int(0) [1039]=> int(0) [1040]=> int(0) [1041]=> int(0) [1042]=> int(0) [1043]=> int(0) [1044]=> int(0) [1045]=> int(0) [1046]=> int(0) [1047]=> int(0) [1048]=> int(0) [1049]=> int(0) [1050]=> int(0) [1051]=> int(0) [1052]=> int(0) [1053]=> int(0) [1054]=> int(0) [1055]=> int(0) [1056]=> int(0) [1057]=> int(0) [1058]=> int(0) [1059]=> int(0) [1060]=> int(0) [1061]=> int(0) [1062]=> int(0) [1063]=> int(0) [1064]=> int(0) [1065]=> int(0) [1066]=> int(0) [1067]=> int(0) [1068]=> int(0) [1069]=> int(0) [1070]=> int(0) [1071]=> int(0) [1072]=> int(0) [1073]=> int(0) [1074]=> int(0) [1075]=> int(0) [1076]=> int(0) [1077]=> int(0) [1078]=> int(0) [1079]=> int(0) }