3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo() { $foo = array(); for($x = 0; $x < 100000; $x++){ $foo[] = pow($x,$x); } return $foo; } $t = microtime(true); foreach(foo() as $val){ $val = $val + 2; } echo round(microtime(true) - $t, 5)."\n"; $t = microtime(true); $foo = foo(); foreach($foo as $val){ $val = $val + 2; } echo round(microtime(true) - $t, 5)."\n";
Output for 7.1.0
0.01271 0.0128
Output for 7.0.14
0.02326 0.02149
Output for 7.0.12
0.02384 0.02182
Output for 7.0.11
0.15028 0.14668
Output for 7.0.10
0.05929 0.04944
Output for 7.0.9
0.0308 0.03916
Output for 7.0.8
0.06693 0.04049
Output for 7.0.7
0.04076 0.04104
Output for 7.0.6
0.03883 0.04203
Output for 7.0.5
0.04176 0.02499
Output for 7.0.4
0.05956 0.02567
Output for 7.0.3
0.02963 0.02713
Output for 7.0.2
0.05146 0.03352
Output for 7.0.1
0.10846 0.10917
Output for 7.0.0
0.12826 0.11092
Output for hhvm-3.13.2
0.05544 0.05599
Output for hhvm-3.12.0
0.03151 0.03078
Output for hhvm-3.10.0
0.05437 0.0565
Output for 5.6.28
0.05558 0.04313
Output for 5.6.26
0.04302 0.03422
Output for 5.6.25
0.05013 0.03466
Output for 5.6.24
0.04148 0.03207
Output for 5.6.23
0.04778 0.03757
Output for 5.6.22
0.03462 0.03085
Output for 5.6.21
0.03465 0.03098
Output for 5.6.20
0.04022 0.03658
Output for 5.6.19
0.0408 0.03238
Output for 5.6.18
0.03543 0.03212
Output for 5.6.17
0.03587 0.03161
Output for 5.6.16
0.04332 0.03198
Output for 5.6.15
0.04072 0.03293
Output for 5.6.14
0.05188 0.03421
Output for 5.6.13
0.04291 0.03333
Output for 5.6.12
0.04729 0.03303
Output for 5.6.11
0.04157 0.03233
Output for 5.6.10
0.04424 0.03371
Output for 5.6.9
0.03956 0.03235
Output for 5.6.8
0.04628 0.03457
Output for 5.6.7
0.05081 0.03647
Output for 5.6.6
0.0509 0.04036
Output for 5.6.5
0.05109 0.0392
Output for 5.6.4
0.05008 0.03477
Output for 5.6.3
0.04691 0.03966
Output for 5.6.2
0.04793 0.03205
Output for 5.6.1
0.05721 0.04336
Output for 5.6.0
0.04783 0.0434
Output for 5.5.38
0.03613 0.03263
Output for 5.5.37
0.05121 0.03533
Output for 5.5.36
0.03977 0.03215
Output for 5.5.35
0.0394 0.03253
Output for 5.5.34
0.06722 0.05072
Output for 5.5.33
0.03677 0.03244
Output for 5.5.32
0.03559 0.03187
Output for 5.5.31
0.0631 0.04599
Output for 5.5.30
0.04763 0.03717
Output for 5.5.29
0.05657 0.03943
Output for 5.5.28
0.04347 0.03312
Output for 5.5.27
0.06274 0.04745
Output for 5.5.26
0.04636 0.03626
Output for 5.5.25
0.04574 0.03241
Output for 5.5.24
0.04393 0.03496
Output for 5.5.23
0.04594 0.034
Output for 5.5.22
0.05163 0.0403
Output for 5.5.21
0.04535 0.03417
Output for 5.5.20
0.04524 0.03473
Output for 5.5.19
0.05003 0.03742
Output for 5.5.18
0.04493 0.03277
Output for 5.5.16
0.04719 0.0341
Output for 5.5.15
0.0503 0.03979
Output for 5.5.14
0.05218 0.04477
Output for 5.5.13
0.07564 0.04654
Output for 5.5.12
0.05255 0.04819
Output for 5.5.11
0.05108 0.03853
Output for 5.5.10
0.04697 0.03424
Output for 5.5.9
0.05064 0.03293
Output for 5.5.8
0.05054 0.04006
Output for 5.5.7
0.04209 0.03246
Output for 5.5.6
0.05294 0.03747
Output for 5.5.5
0.04403 0.03412
Output for 5.5.4
0.05295 0.04061
Output for 5.5.3
0.04486 0.03423
Output for 5.5.2
0.05408 0.04093
Output for 5.5.1
0.05563 0.04324
Output for 5.5.0
0.04372 0.0339
Output for 5.4.45
0.04743 0.04031
Output for 5.4.44
0.0476 0.03289
Output for 5.4.43
0.04404 0.03293
Output for 5.4.42
0.04662 0.03458
Output for 5.4.41
0.05085 0.03539
Output for 5.4.40
0.04423 0.03452
Output for 5.4.39
0.0538 0.03796
Output for 5.4.38
0.0488 0.03758
Output for 5.4.37
0.04383 0.03397
Output for 5.4.36
0.03917 0.03242
Output for 5.4.35
0.04643 0.03641
Output for 5.4.34
0.05939 0.04249
Output for 5.4.32
0.048 0.03317
Output for 5.4.31
0.04884 0.03853
Output for 5.4.30
0.0437 0.03507
Output for 5.4.29
0.05255 0.04081
Output for 5.4.28
0.04764 0.03744
Output for 5.4.27
0.04946 0.03802
Output for 5.4.26
0.04842 0.03257
Output for 5.4.25
0.0488 0.03823
Output for 5.4.24
0.05435 0.04174
Output for 5.4.23
0.0588 0.04443
Output for 5.4.22
0.05024 0.04214
Output for 5.4.21
0.0435 0.03389
Output for 5.4.20
0.04689 0.03617
Output for 5.4.19
0.04399 0.0334
Output for 5.4.18
0.04852 0.03391
Output for 5.4.17
0.04556 0.03434
Output for 5.4.16
0.04854 0.03421
Output for 5.4.15
0.04796 0.03407
Output for 5.4.14
0.04985 0.03639
Output for 5.4.13
0.04751 0.03413
Output for 5.4.12
0.04746 0.03495
Output for 5.4.11
0.05117 0.035
Output for 5.4.10
0.0417 0.03245
Output for 5.4.9
0.04704 0.0358
Output for 5.4.8
0.05111 0.0373
Output for 5.4.7
0.04531 0.03243
Output for 5.4.6
0.03845 0.03187
Output for 5.4.5
0.0531 0.03444
Output for 5.4.4
0.0481 0.03377
Output for 5.4.3
0.04402 0.0339
Output for 5.4.2
0.04768 0.03814
Output for 5.4.1
0.04661 0.0345
Output for 5.4.0
0.0559 0.04248
Output for 5.3.29
0.05369 0.03543
Output for 5.3.28
0.05941 0.04249
Output for 5.3.27
0.06014 0.04137
Output for 5.3.26
0.05241 0.03919
Output for 5.3.25
0.04553 0.0386
Output for 5.3.24
0.05161 0.03533
Output for 5.3.23
0.05754 0.03847
Output for 5.3.22
0.05471 0.0352
Output for 5.3.21
0.05298 0.03322
Output for 5.3.20
0.04994 0.03507
Output for 5.3.19
0.0491 0.03617
Output for 5.3.18
0.04981 0.03706
Output for 5.3.17
0.05879 0.03514
Output for 5.3.16
0.05327 0.03617
Output for 5.3.15
0.04446 0.03334
Output for 5.3.14
0.04844 0.0333
Output for 5.3.13
0.05276 0.03891
Output for 5.3.12
0.03897 0.03276
Output for 5.3.11
0.05104 0.03393
Output for 5.3.10
0.04843 0.03394
Output for 5.3.9
0.04127 0.03379
Output for 5.3.8
0.05461 0.0394
Output for 5.3.7
0.0526 0.03322
Output for 5.3.6
0.0395 0.03293
Output for 5.3.5
0.04554 0.03329
Output for 5.3.4
0.05245 0.03535
Output for 5.3.3
0.05 0.0343
Output for 5.3.2
0.05115 0.03474
Output for 5.3.1
0.05847 0.03684
Output for 5.3.0
0.05538 0.04013
Output for 5.2.17
0.05918 0.04574
Output for 5.2.16
0.06452 0.04657
Output for 5.2.15
0.05917 0.04396
Output for 5.2.14
0.05131 0.04062
Output for 5.2.13
0.06293 0.04819
Output for 5.2.12
0.06609 0.04524
Output for 5.2.11
0.06757 0.05037
Output for 5.2.10
0.05706 0.04454
Output for 5.2.9
0.06887 0.05117
Output for 5.2.8
0.06562 0.04786
Output for 5.2.7
0.05977 0.04047
Output for 5.2.6
0.06774 0.049
Output for 5.2.5
0.06647 0.04837
Output for 5.2.4
0.07234 0.05124
Output for 5.2.3
0.06124 0.04326
Output for 5.2.2
0.06414 0.04347
Output for 5.2.1
0.0523 0.03523
Output for 5.2.0
0.05303 0.03929
Output for 5.1.6
0.06275 0.05085
Output for 5.1.5
0.0732 0.04962
Output for 5.1.4
0.053 0.04075
Output for 5.1.3
0.05943 0.04164
Output for 5.1.2
0.04589 0.04151
Output for 5.1.1
0.06628 0.04375
Output for 5.1.0
0.06685 0.04885
Output for 5.0.5
0.11503 0.07745
Output for 5.0.4
0.12211 0.09941
Output for 5.0.3
0.1094 0.07675
Output for 5.0.2
0.10478 0.07373
Output for 5.0.1
0.10512 0.07411
Output for 5.0.0
0.0957 0.07243
Output for 4.4.9
0.10676 0.06336
Output for 4.4.8
0.0953 0.06582
Output for 4.4.7
0.07934 0.06626
Output for 4.4.6
0.0893 0.065
Output for 4.4.5
0.09097 0.06285
Output for 4.4.4
0.09208 0.06239
Output for 4.4.3
0.0945 0.06827
Output for 4.4.2
0.11109 0.06858
Output for 4.4.1
0.10566 0.06441
Output for 4.4.0
0.08545 0.06269
Output for 4.3.11
0.10742 0.06819
Output for 4.3.10
0.11017 0.06408
Output for 4.3.9
0.10534 0.09246
Output for 4.3.8
0.1007 0.07304
Output for 4.3.7
0.11493 0.0732
Output for 4.3.6
0.12139 0.07965
Output for 4.3.5
0.10068 0.07017
Output for 4.3.4
0.09406 0.0715
Output for 4.3.3
0.11129 0.07531
Output for 4.3.2
0.11287 0.07165
Output for 4.3.1
0.11931 0.07948
Output for 4.3.0
0.12024 0.07979