3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo() { $foo = array(); for($x = 0; $x < 100000; $x++){ $foo[] = rand(); } 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.00859 0.00782
Output for 7.0.14
0.0083 0.00788
Output for 7.0.10
0.02805 0.01642
Output for 7.0.9
0.0394 0.03404
Output for 7.0.8
0.00783 0.00678
Output for 7.0.7
0.044 0.02152
Output for 7.0.6
0.01927 0.01448
Output for 7.0.5
0.01137 0.00989
Output for 7.0.4
0.01114 0.00989
Output for 7.0.3
0.02593 0.00816
Output for 7.0.2
0.01679 0.00834
Output for 7.0.1
0.011 0.00881
Output for 7.0.0
0.01081 0.00947
Output for 5.6.28
0.0382 0.02848
Output for 5.6.25
0.03395 0.02462
Output for 5.6.24
0.05256 0.03363
Output for 5.6.23
0.04155 0.0278
Output for 5.6.22
0.03155 0.02634
Output for 5.6.21
0.02917 0.02384
Output for 5.6.20
0.03428 0.0236
Output for 5.6.19
0.05005 0.03172
Output for 5.6.18
0.03048 0.02267
Output for 5.6.17
0.04275 0.0263
Output for 5.6.16
0.03327 0.02144
Output for 5.6.15
0.0297 0.02187
Output for 5.6.14
0.03628 0.0267
Output for 5.6.13
0.02818 0.02133
Output for 5.6.12
0.03025 0.02204
Output for 5.6.11
0.03505 0.02659
Output for 5.6.10
0.0344 0.02606
Output for 5.6.9
0.0384 0.02701
Output for 5.6.8
0.03086 0.02434
Output for 5.6.7
0.02943 0.02267
Output for 5.6.6
0.03195 0.02313
Output for 5.6.5
0.02442 0.02016
Output for 5.6.4
0.03049 0.02392
Output for 5.6.3
0.04447 0.0306
Output for 5.6.2
0.03017 0.02108
Output for 5.6.1
0.02516 0.02007
Output for 5.6.0
0.03365 0.02017
Output for 5.5.38
0.02549 0.01992
Output for 5.5.37
0.02714 0.01972
Output for 5.5.36
0.0289 0.02093
Output for 5.5.35
0.0295 0.02266
Output for 5.5.34
0.0339 0.02243
Output for 5.5.33
0.03257 0.02245
Output for 5.5.32
0.03081 0.02538
Output for 5.5.31
0.04704 0.03352
Output for 5.5.30
0.03512 0.02358
Output for 5.5.29
0.03099 0.02105
Output for 5.5.28
0.02907 0.0216
Output for 5.5.27
0.03706 0.02664
Output for 5.5.26
0.03123 0.02325
Output for 5.5.25
0.03603 0.02773
Output for 5.5.24
0.03725 0.02774
Output for 5.5.23
0.03376 0.02451
Output for 5.5.22
0.02992 0.02288
Output for 5.5.21
0.02855 0.02301
Output for 5.5.20
0.03295 0.02583
Output for 5.5.19
0.03039 0.0219
Output for 5.5.18
0.03077 0.0223
Output for 5.5.16
0.03524 0.02736
Output for 5.5.15
0.02407 0.01931
Output for 5.5.14
0.03241 0.02303
Output for 5.5.13
0.03029 0.0285
Output for 5.5.12
0.03803 0.02766
Output for 5.5.11
0.02977 0.02169
Output for 5.5.10
0.03265 0.0253
Output for 5.5.9
0.03487 0.02649
Output for 5.5.8
0.03451 0.0257
Output for 5.5.7
0.02692 0.02052
Output for 5.5.6
0.03191 0.02364
Output for 5.5.5
0.03068 0.02377
Output for 5.5.4
0.03388 0.02206
Output for 5.5.3
0.03088 0.0237
Output for 5.5.2
0.03437 0.02363
Output for 5.5.1
0.03312 0.02584
Output for 5.5.0
0.03725 0.02687
Output for 5.4.45
0.03331 0.02167
Output for 5.4.44
0.04 0.02596
Output for 5.4.43
0.03071 0.02336
Output for 5.4.42
0.03225 0.02452
Output for 5.4.41
0.03738 0.02797
Output for 5.4.40
0.02944 0.02129
Output for 5.4.39
0.03423 0.02628
Output for 5.4.38
0.0312 0.02241
Output for 5.4.37
0.03469 0.02593
Output for 5.4.36
0.03057 0.02424
Output for 5.4.35
0.02613 0.02093
Output for 5.4.34
0.03415 0.02323
Output for 5.4.32
0.03057 0.02205
Output for 5.4.31
0.03966 0.02377
Output for 5.4.30
0.0323 0.0277
Output for 5.4.29
0.03328 0.02225
Output for 5.4.28
0.03513 0.02427
Output for 5.4.27
0.03988 0.02899
Output for 5.4.26
0.03408 0.0233
Output for 5.4.25
0.03834 0.02877
Output for 5.4.24
0.0448 0.03439
Output for 5.4.23
0.03681 0.02883
Output for 5.4.22
0.02945 0.02336
Output for 5.4.21
0.03565 0.02642
Output for 5.4.20
0.03046 0.02311
Output for 5.4.19
0.03734 0.02855
Output for 5.4.18
0.03221 0.02041
Output for 5.4.17
0.03429 0.02517
Output for 5.4.16
0.03141 0.02452
Output for 5.4.15
0.03311 0.02405
Output for 5.4.14
0.03395 0.02576
Output for 5.4.13
0.03796 0.02814
Output for 5.4.12
0.03167 0.02476
Output for 5.4.11
0.0324 0.02092
Output for 5.4.10
0.03745 0.0245
Output for 5.4.9
0.03601 0.02824
Output for 5.4.8
0.03362 0.02288
Output for 5.4.7
0.03533 0.02225
Output for 5.4.6
0.03095 0.02197
Output for 5.4.5
0.03566 0.02379
Output for 5.4.4
0.02669 0.02267
Output for 5.4.3
0.03879 0.02583
Output for 5.4.2
0.03295 0.02816
Output for 5.4.1
0.03028 0.02592
Output for 5.4.0
0.0369 0.02852
Output for 5.3.29
0.0341 0.0215
Output for 5.3.28
0.03347 0.02368
Output for 5.3.27
0.03126 0.02177
Output for 5.3.26
0.03383 0.02156
Output for 5.3.25
0.0364 0.02185
Output for 5.3.24
0.03006 0.02151
Output for 5.3.23
0.03716 0.02483
Output for 5.3.22
0.04153 0.0272
Output for 5.3.21
0.03977 0.02631
Output for 5.3.20
0.03693 0.02234
Output for 5.3.19
0.03926 0.02516
Output for 5.3.18
0.03518 0.02146
Output for 5.3.17
0.03249 0.01975
Output for 5.3.16
0.03881 0.02358
Output for 5.3.15
0.04156 0.02248
Output for 5.3.14
0.03764 0.0242
Output for 5.3.13
0.02801 0.02027
Output for 5.3.12
0.03418 0.02676
Output for 5.3.11
0.03051 0.02038
Output for 5.3.10
0.03521 0.02719
Output for 5.3.9
0.04028 0.02779
Output for 5.3.8
0.03483 0.0216
Output for 5.3.7
0.03956 0.0263
Output for 5.3.6
0.02693 0.01952
Output for 5.3.5
0.03839 0.02437
Output for 5.3.4
0.03626 0.01992
Output for 5.3.3
0.0295 0.02032
Output for 5.3.2
0.03709 0.02325
Output for 5.3.1
0.03349 0.02402
Output for 5.3.0
0.03367 0.02494
Output for 5.2.17
0.04874 0.03751
Output for 5.2.16
0.04145 0.03331
Output for 5.2.15
0.04124 0.03363
Output for 5.2.14
0.04523 0.03397
Output for 5.2.13
0.04961 0.03771
Output for 5.2.12
0.04531 0.03015
Output for 5.2.11
0.04662 0.0343
Output for 5.2.10
0.0453 0.02933
Output for 5.2.9
0.03738 0.02922
Output for 5.2.8
0.03983 0.03068
Output for 5.2.7
0.04534 0.03624
Output for 5.2.6
0.03111 0.02795
Output for 5.2.5
0.04735 0.03153
Output for 5.2.4
0.05128 0.03519
Output for 5.2.3
0.05082 0.03535
Output for 5.2.2
0.05865 0.03577
Output for 5.2.1
0.04638 0.0353
Output for 5.2.0
0.04055 0.02725
Output for 5.1.6
0.05452 0.03991
Output for 5.1.5
0.05002 0.03127
Output for 5.1.4
0.05164 0.03439
Output for 5.1.3
0.05434 0.03825
Output for 5.1.2
0.04784 0.03232
Output for 5.1.1
0.05435 0.03815
Output for 5.1.0
0.04196 0.02958
Output for 5.0.5
0.08017 0.05546
Output for 5.0.4
0.08354 0.05467
Output for 5.0.3
0.06892 0.0537
Output for 5.0.2
0.08747 0.05783
Output for 5.0.1
0.09354 0.06547
Output for 5.0.0
0.07159 0.05344
Output for 4.4.9
0.1169 0.05133
Output for 4.4.8
0.08192 0.0561
Output for 4.4.7
0.08062 0.04746
Output for 4.4.6
0.05465 0.04551
Output for 4.4.5
0.06862 0.05626
Output for 4.4.4
0.06326 0.04451
Output for 4.4.3
0.05132 0.04262
Output for 4.4.2
0.0785 0.05243
Output for 4.4.1
0.07904 0.05053
Output for 4.4.0
0.0708 0.04763
Output for 4.3.11
0.07947 0.0466
Output for 4.3.10
0.07165 0.04759
Output for 4.3.9
0.08632 0.05565
Output for 4.3.8
0.07444 0.05459
Output for 4.3.7
0.10101 0.06812
Output for 4.3.6
0.09274 0.06626
Output for 4.3.5
0.09549 0.0636
Output for 4.3.4
0.06299 0.05356
Output for 4.3.3
0.08867 0.05506
Output for 4.3.2
0.2073 0.16958
Output for 4.3.1
0.19511 0.1754
Output for 4.3.0
0.17854 0.17098