3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for ($a = 0; $a < 5; $a++) { $start = microtime(true); for ($i = 0; $i < 10000; $i++) { $args = ['a', 'b']; foreach ($args as $arg) { $arg = (string)$arg; } } echo round(microtime(true) - $start, 5) . PHP_EOL; $start = microtime(true); for ($i = 0; $i < 10000; $i++) { $args = ['a', 'b']; while (count($args)) { $arg = (string)array_shift($args); } } echo round(microtime(true) - $start, 5) . PHP_EOL; }
Output for 7.1.0
0.00102 0.00347 0.0011 0.00325 0.00107 0.00315 0.00097 0.00309 0.00102 0.00306
Output for 7.0.14
0.00153 0.00359 0.00154 0.00356 0.00157 0.00341 0.00158 0.00341 0.00149 0.00327
Output for 7.0.6
0.00138 0.00268 0.00132 0.00271 0.00132 0.00265 0.00128 0.00258 0.00126 0.00261
Output for 7.0.5
0.0008 0.00173 0.0008 0.00175 0.00081 0.00173 0.00081 0.00172 0.0008 0.00178
Output for 7.0.4
0.00085 0.00179 0.00086 0.00178 0.00087 0.00173 0.00143 0.00226 0.00084 0.00173
Output for 7.0.3
0.00093 0.00196 0.00095 0.00192 0.00095 0.00193 0.00095 0.00189 0.00093 0.00186
Output for 7.0.2
0.00084 0.00183 0.00086 0.00183 0.00086 0.00182 0.00086 0.00182 0.00086 0.00182
Output for 7.0.1
0.00117 0.00247 0.00121 0.00244 0.00123 0.0024 0.00115 0.00237 0.00116 0.00234
Output for 7.0.0
0.00111 0.00227 0.00118 0.0025 0.00109 0.00228 0.00107 0.00244 0.00105 0.00225
Output for 5.6.28
0.00526 0.01215 0.00506 0.01146 0.00477 0.01092 0.00451 0.01051 0.0043 0.01007
Output for 5.6.21
0.00257 0.006 0.00256 0.00582 0.00258 0.00601 0.00257 0.00586 0.00256 0.00585
Output for 5.6.20
0.00378 0.00833 0.00353 0.00796 0.00341 0.00787 0.00327 0.00646 0.00255 0.00581
Output for 5.6.19
0.00254 0.00598 0.00256 0.00599 0.00254 0.00586 0.00255 0.00588 0.00254 0.00589
Output for 5.6.18
0.00359 0.00661 0.0027 0.00591 0.00271 0.00598 0.00277 0.00595 0.00272 0.0058
Output for 5.6.17
0.00298 0.00662 0.00287 0.00701 0.00279 0.0062 0.0029 0.0065 0.00267 0.00588
Output for 5.6.16
0.00249 0.00566 0.00247 0.00573 0.00246 0.00568 0.00248 0.00567 0.00247 0.00571
Output for 5.6.15
0.00349 0.00791 0.00334 0.00787 0.00323 0.00719 0.0031 0.00695 0.003 0.00683
Output for 5.6.14
0.00484 0.01061 0.00472 0.00952 0.00496 0.00897 0.0034 0.00745 0.00362 0.00698
Output for 5.6.13
0.00405 0.00905 0.00388 0.00852 0.0037 0.00805 0.00353 0.00767 0.00336 0.00734
Output for 5.6.12
0.0025 0.00613 0.00251 0.00565 0.00242 0.00599 0.00243 0.0056 0.00253 0.00561
Output for 5.6.11
0.00245 0.0062 0.0026 0.00556 0.00243 0.00564 0.00243 0.00633 0.00243 0.00562
Output for 5.6.10
0.00342 0.00756 0.00325 0.00724 0.00311 0.00692 0.00299 0.00675 0.00292 0.00655
Output for 5.6.9
0.00513 0.00847 0.00335 0.00758 0.00433 0.00727 0.00357 0.00751 0.00344 0.00669
Output for 5.6.8
0.00363 0.00832 0.00347 0.00798 0.00332 0.00754 0.0032 0.00724 0.00308 0.00698
Output for 5.6.7
0.00254 0.00569 0.00257 0.00572 0.00253 0.00576 0.00253 0.00578 0.00253 0.00577
Output for 5.5.35
0.00411 0.0094 0.00395 0.0089 0.00367 0.00834 0.00345 0.00798 0.00331 0.0063
Output for 5.5.34
0.0044 0.00689 0.00304 0.00723 0.00339 0.00865 0.00327 0.00912 0.00334 0.00701
Output for 5.5.33
0.00421 0.00951 0.004 0.00907 0.00376 0.00851 0.00356 0.00815 0.00338 0.00779
Output for 5.5.32
0.00372 0.00838 0.00355 0.00801 0.0034 0.00764 0.00327 0.0074 0.00315 0.00713
Output for 5.5.31
0.00309 0.00611 0.00265 0.0061 0.00268 0.0061 0.00267 0.0061 0.00267 0.00613
Output for 5.5.30
0.00368 0.00799 0.00344 0.00769 0.00325 0.00743 0.00313 0.00733 0.00302 0.00691
Output for 5.5.29
0.00423 0.00945 0.00393 0.00885 0.00376 0.00851 0.00353 0.00815 0.00339 0.00778
Output for 5.5.28
0.00261 0.00597 0.00259 0.00593 0.00259 0.00598 0.00259 0.00598 0.0026 0.00597
Output for 5.5.27
0.00267 0.00604 0.00267 0.00604 0.00266 0.00604 0.00285 0.00604 0.00267 0.00607
Output for 5.5.26
0.00812 0.01166 0.00783 0.01114 0.00559 0.01262 0.00313 0.00895 0.00298 0.00676
Output for 5.5.25
0.00346 0.00807 0.00331 0.00868 0.00319 0.00829 0.00308 0.00796 0.00381 0.00681
Output for 5.5.24
0.00304 0.0069 0.00298 0.00673 0.00288 0.00652 0.00279 0.00634 0.00271 0.00606
Output for 5.4.45
0.03086 0.03711 0.00485 0.00992 0.00494 0.01881 0.00467 0.02083 0.00423 0.02108
Output for 5.4.44
0.00236 0.00528 0.0023 0.00578 0.00364 0.00869 0.00457 0.01102 0.00419 0.01094
Output for 5.4.43
0.00253 0.00619 0.00344 0.00841 0.00356 0.00822 0.00361 0.00835 0.00356 0.00822
Output for 5.4.42
0.00445 0.01093 0.00375 0.01006 0.00491 0.00973 0.0039 0.00896 0.00421 0.01076
Output for 5.4.41
0.01282 0.02126 0.0101 0.02289 0.0081 0.00956 0.00442 0.02146 0.00405 0.02995
Output for 5.4.40
0.00358 0.01787 0.0042 0.02447 0.0077 0.0288 0.00427 0.00886 0.00486 0.01037
Output for 5.4.39
0.00526 0.01063 0.00413 0.01274 0.00442 0.00972 0.005 0.01026 0.00361 0.01636
Output for 5.4.38
0.00426 0.01002 0.00414 0.00985 0.00412 0.01009 0.00415 0.00998 0.00407 0.01042
Output for 5.4.37
0.00766 0.01614 0.00482 0.01037 0.00439 0.01195 0.00455 0.01078 0.00439 0.00978
Output for 5.4.36
0.00429 0.01258 0.00539 0.01313 0.00425 0.01116 0.00428 0.01052 0.00425 0.0107
Output for 5.4.35
0.00383 0.00985 0.00391 0.0098 0.00398 0.00976 0.00389 0.00967 0.00406 0.01081
Output for 5.4.34
0.00582 0.01161 0.00463 0.01221 0.00468 0.01139 0.00508 0.01083 0.00526 0.01105
Output for 5.4.32
0.00297 0.00712 0.00309 0.00736 0.00282 0.00709 0.00327 0.0079 0.00289 0.00746
Output for 5.4.31
0.00332 0.00781 0.0032 0.00788 0.0032 0.00824 0.0032 0.00785 0.00315 0.00771
Output for 5.4.30
0.00292 0.00707 0.00292 0.00729 0.00292 0.00723 0.00303 0.00724 0.00299 0.00724
Output for 5.4.29
0.00314 0.00734 0.00319 0.0073 0.00321 0.0074 0.00317 0.00748 0.0032 0.00746
Output for 5.4.28
0.00321 0.0091 0.00371 0.0104 0.00346 0.00906 0.0031 0.0088 0.00306 0.00922
Output for 5.4.27
0.0031 0.00818 0.00312 0.00826 0.00307 0.00799 0.00311 0.0083 0.00304 0.00809
Output for 5.4.26
0.00322 0.00746 0.00312 0.00748 0.00302 0.00731 0.00305 0.0074 0.00311 0.00759
Output for 5.4.25
0.00318 0.00793 0.00317 0.0079 0.00316 0.00803 0.00325 0.00799 0.00318 0.00793
Output for 5.4.24
0.00313 0.00777 0.00313 0.00754 0.00301 0.00755 0.00305 0.00761 0.00306 0.00782
Output for 5.4.23
0.00484 0.0128 0.00422 0.00858 0.00378 0.01313 0.00556 0.01079 0.0033 0.00965
Output for 5.4.22
0.00331 0.00804 0.00327 0.00994 0.00545 0.00917 0.00343 0.00784 0.00335 0.00754
Output for 5.4.21
0.00312 0.00825 0.00321 0.00823 0.00324 0.00833 0.0032 0.00817 0.00324 0.00828
Output for 5.4.20
0.00305 0.00735 0.00315 0.00738 0.00316 0.00777 0.00314 0.00731 0.00308 0.00744
Output for 5.4.19
0.00407 0.00883 0.00347 0.00787 0.00338 0.00817 0.00332 0.00769 0.0032 0.00803
Output for 5.4.18
0.00334 0.00789 0.00339 0.00796 0.00346 0.01077 0.006 0.00918 0.00463 0.0109
Output for 5.4.17
0.00362 0.00825 0.0032 0.00825 0.00352 0.00821 0.00325 0.00811 0.00341 0.00807
Output for 5.4.16
0.00312 0.00982 0.00338 0.00852 0.00333 0.0084 0.00344 0.00828 0.00437 0.00891
Output for 5.4.15
0.00373 0.00763 0.00322 0.00742 0.00319 0.00732 0.00305 0.00832 0.0031 0.00858
Output for 5.4.14
0.00355 0.00746 0.00365 0.00752 0.00353 0.00725 0.00345 0.0074 0.0035 0.00735
Output for 5.4.13
0.00317 0.00803 0.00319 0.00794 0.00324 0.00861 0.00323 0.00825 0.00315 0.0096
Output for 5.4.12
0.00324 0.0083 0.00326 0.00822 0.00331 0.00814 0.0032 0.00819 0.00322 0.00813
Output for 5.4.11
0.00333 0.00844 0.00324 0.00797 0.00319 0.00879 0.0033 0.00819 0.00321 0.00787
Output for 5.4.10
0.0034 0.00823 0.00335 0.00807 0.00355 0.0104 0.00606 0.0139 0.00611 0.00835
Output for 5.4.9
0.00328 0.00809 0.00322 0.00798 0.00322 0.00809 0.00319 0.00802 0.00316 0.00802
Output for 5.4.8
0.00421 0.00803 0.00415 0.00799 0.00404 0.00805 0.00403 0.00843 0.0042 0.00826
Output for 5.4.7
0.00339 0.00811 0.00325 0.00794 0.00342 0.00796 0.00395 0.00982 0.00339 0.00788
Output for 5.4.6
0.00356 0.008 0.0036 0.00773 0.00459 0.00883 0.00354 0.00781 0.00372 0.00837
Output for 5.4.5
0.00531 0.01328 0.00548 0.00905 0.00327 0.00817 0.00313 0.00805 0.00324 0.00869
Output for 5.4.4
0.00323 0.00818 0.00322 0.00802 0.00327 0.00817 0.00338 0.00807 0.00326 0.00846
Output for 5.4.3
0.00366 0.01386 0.00628 0.01467 0.00433 0.00882 0.00349 0.00885 0.00328 0.00866
Output for 5.4.2
0.00314 0.00778 0.00305 0.00766 0.00306 0.00784 0.0031 0.00785 0.00303 0.00815
Output for 5.4.1
0.00596 0.01538 0.00458 0.00885 0.00339 0.00911 0.00342 0.00891 0.00336 0.00883
Output for 5.4.0
0.00336 0.00837 0.00338 0.00862 0.00329 0.0085 0.00326 0.00852 0.0032 0.00854
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/JZfqR on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/JZfqR on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/JZfqR on line 6
Process exited with code 255.