3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $count = 50; $start = microtime(true); $y = 0; // for($i = 0; $i < $count; $i++) // { $code = ' $ret = ""; for ($i=0; $i<100; $i++) { $ret.= md5($i.$ret); } return $ret; '; eval($code); // } printf("#1, result is %d, done in %f\n", $y, microtime(true) - $start); $start = microtime(true); $y = 0; // for($i = 0; $i < $count; $i++) // { $f = function() { // return ++$y; $ret = ''; for ($i=0; $i<100; $i++) { $ret.= md5($i.$ret); } return $ret; }; $f(); // } printf("#2, result is %d, done in %f\n", $y, microtime(true) - $start); $fName = create_function('', $code); $fName(); printf("#3, done in %f\n", microtime(true) - $start); ?>
Output for 7.1.0
#1, result is 0, done in 0.000362 #2, result is 0, done in 0.000344 #3, done in 0.000710
Output for 7.0.14
#1, result is 0, done in 0.000489 #2, result is 0, done in 0.000478 #3, done in 0.000984
Output for 7.0.10
#1, result is 0, done in 0.000410 #2, result is 0, done in 0.000379 #3, done in 0.000806
Output for 7.0.9
#1, result is 0, done in 0.000546 #2, result is 0, done in 0.000481 #3, done in 0.000984
Output for 7.0.8
#1, result is 0, done in 0.000490 #2, result is 0, done in 0.000463 #3, done in 0.000953
Output for 7.0.7
#1, result is 0, done in 0.000351 #2, result is 0, done in 0.000312 #3, done in 0.000644
Output for 7.0.6
#1, result is 0, done in 0.000488 #2, result is 0, done in 0.000456 #3, done in 0.000938
Output for 7.0.5
#1, result is 0, done in 0.000325 #2, result is 0, done in 0.000307 #3, done in 0.000627
Output for 7.0.4
#1, result is 0, done in 0.000461 #2, result is 0, done in 0.000441 #3, done in 0.000911
Output for 7.0.3
#1, result is 0, done in 0.000488 #2, result is 0, done in 0.000493 #3, done in 0.000999
Output for 7.0.2
#1, result is 0, done in 0.000492 #2, result is 0, done in 0.000491 #3, done in 0.000995
Output for 7.0.1
#1, result is 0, done in 0.000353 #2, result is 0, done in 0.000339 #3, done in 0.000698
Output for 7.0.0
#1, result is 0, done in 0.000469 #2, result is 0, done in 0.000464 #3, done in 0.000949
Output for 5.6.28
#1, result is 0, done in 0.000519 #2, result is 0, done in 0.000516 #3, done in 0.001069
Output for 5.6.25
#1, result is 0, done in 0.000423 #2, result is 0, done in 0.000396 #3, done in 0.000829
Output for 5.6.24
#1, result is 0, done in 0.000321 #2, result is 0, done in 0.000327 #3, done in 0.000711
Output for 5.6.23
#1, result is 0, done in 0.000514 #2, result is 0, done in 0.000510 #3, done in 0.001043
Output for 5.6.22
#1, result is 0, done in 0.000358 #2, result is 0, done in 0.000339 #3, done in 0.000703
Output for 5.6.21
#1, result is 0, done in 0.000415 #2, result is 0, done in 0.000398 #3, done in 0.000828
Output for 5.6.20
#1, result is 0, done in 0.000491 #2, result is 0, done in 0.000468 #3, done in 0.000977
Output for 5.6.19
#1, result is 0, done in 0.000331 #2, result is 0, done in 0.000315 #3, done in 0.000658
Output for 5.6.18
#1, result is 0, done in 0.000487 #2, result is 0, done in 0.000473 #3, done in 0.000978
Output for 5.6.17
#1, result is 0, done in 0.000463 #2, result is 0, done in 0.000414 #3, done in 0.000769
Output for 5.6.16
#1, result is 0, done in 0.000370 #2, result is 0, done in 0.000353 #3, done in 0.000727
Output for 5.6.15
#1, result is 0, done in 0.000444 #2, result is 0, done in 0.000382 #3, done in 0.000796
Output for 5.6.14
#1, result is 0, done in 0.000532 #2, result is 0, done in 0.000585 #3, done in 0.001163
Output for 5.6.13
#1, result is 0, done in 0.000403 #2, result is 0, done in 0.000384 #3, done in 0.000831
Output for 5.6.12
#1, result is 0, done in 0.000357 #2, result is 0, done in 0.000344 #3, done in 0.000713
Output for 5.6.11
#1, result is 0, done in 0.000468 #2, result is 0, done in 0.000446 #3, done in 0.000935
Output for 5.6.10
#1, result is 0, done in 0.000314 #2, result is 0, done in 0.000302 #3, done in 0.000631
Output for 5.6.9
#1, result is 0, done in 0.000355 #2, result is 0, done in 0.000338 #3, done in 0.000710
Output for 5.6.8
#1, result is 0, done in 0.000407 #2, result is 0, done in 0.000359 #3, done in 0.000763
Output for 5.6.7
#1, result is 0, done in 0.000375 #2, result is 0, done in 0.000355 #3, done in 0.000744
Output for 5.6.6
#1, result is 0, done in 0.000427 #2, result is 0, done in 0.000405 #3, done in 0.000840
Output for 5.6.5
#1, result is 0, done in 0.000386 #2, result is 0, done in 0.000348 #3, done in 0.000735
Output for 5.6.4
#1, result is 0, done in 0.000471 #2, result is 0, done in 0.000428 #3, done in 0.000895
Output for 5.6.3
#1, result is 0, done in 0.000367 #2, result is 0, done in 0.000349 #3, done in 0.000731
Output for 5.6.2
#1, result is 0, done in 0.000395 #2, result is 0, done in 0.000380 #3, done in 0.000789
Output for 5.6.1
#1, result is 0, done in 0.000382 #2, result is 0, done in 0.000362 #3, done in 0.000749
Output for 5.6.0
#1, result is 0, done in 0.000409 #2, result is 0, done in 0.000390 #3, done in 0.000816
Output for 5.5.38
#1, result is 0, done in 0.000500 #2, result is 0, done in 0.000475 #3, done in 0.000991
Output for 5.5.37
#1, result is 0, done in 0.000346 #2, result is 0, done in 0.000339 #3, done in 0.000702
Output for 5.5.36
#1, result is 0, done in 0.000341 #2, result is 0, done in 0.000304 #3, done in 0.000630
Output for 5.5.35
#1, result is 0, done in 0.000434 #2, result is 0, done in 0.000414 #3, done in 0.000900
Output for 5.5.34
#1, result is 0, done in 0.000355 #2, result is 0, done in 0.000337 #3, done in 0.000701
Output for 5.5.33
#1, result is 0, done in 0.000446 #2, result is 0, done in 0.000425 #3, done in 0.000881
Output for 5.5.32
#1, result is 0, done in 0.000339 #2, result is 0, done in 0.000336 #3, done in 0.000698
Output for 5.5.31
#1, result is 0, done in 0.000415 #2, result is 0, done in 0.000396 #3, done in 0.000819
Output for 5.5.30
#1, result is 0, done in 0.000415 #2, result is 0, done in 0.000391 #3, done in 0.000809
Output for 5.5.29
#1, result is 0, done in 0.000446 #2, result is 0, done in 0.000442 #3, done in 0.000902
Output for 5.5.28
#1, result is 0, done in 0.000466 #2, result is 0, done in 0.000443 #3, done in 0.000920
Output for 5.5.27
#1, result is 0, done in 0.000431 #2, result is 0, done in 0.000390 #3, done in 0.000795
Output for 5.5.26
#1, result is 0, done in 0.000517 #2, result is 0, done in 0.000501 #3, done in 0.001012
Output for 5.5.25
#1, result is 0, done in 0.000406 #2, result is 0, done in 0.000380 #3, done in 0.000790
Output for 5.5.24
#1, result is 0, done in 0.000450 #2, result is 0, done in 0.000428 #3, done in 0.000895
Output for 5.5.23
#1, result is 0, done in 0.000357 #2, result is 0, done in 0.000347 #3, done in 0.000721
Output for 5.5.22
#1, result is 0, done in 0.000468 #2, result is 0, done in 0.000445 #3, done in 0.000969
Output for 5.5.21
#1, result is 0, done in 0.000413 #2, result is 0, done in 0.000394 #3, done in 0.000824
Output for 5.5.20
#1, result is 0, done in 0.000492 #2, result is 0, done in 0.000477 #3, done in 0.000991
Output for 5.5.19
#1, result is 0, done in 0.000471 #2, result is 0, done in 0.000446 #3, done in 0.000933
Output for 5.5.18
#1, result is 0, done in 0.000540 #2, result is 0, done in 0.000516 #3, done in 0.001087
Output for 5.5.16
#1, result is 0, done in 0.000492 #2, result is 0, done in 0.000489 #3, done in 0.001037
Output for 5.5.15
#1, result is 0, done in 0.000399 #2, result is 0, done in 0.000362 #3, done in 0.000763
Output for 5.5.14
#1, result is 0, done in 0.000446 #2, result is 0, done in 0.000425 #3, done in 0.000893
Output for 5.5.13
#1, result is 0, done in 0.000431 #2, result is 0, done in 0.000416 #3, done in 0.000857
Output for 5.5.12
#1, result is 0, done in 0.000560 #2, result is 0, done in 0.000447 #3, done in 0.000937
Output for 5.5.11
#1, result is 0, done in 0.000446 #2, result is 0, done in 0.000428 #3, done in 0.000893
Output for 5.5.10
#1, result is 0, done in 0.000510 #2, result is 0, done in 0.000487 #3, done in 0.001018
Output for 5.5.9
#1, result is 0, done in 0.000398 #2, result is 0, done in 0.000385 #3, done in 0.000806
Output for 5.5.8
#1, result is 0, done in 0.000430 #2, result is 0, done in 0.000412 #3, done in 0.000857
Output for 5.5.7
#1, result is 0, done in 0.000516 #2, result is 0, done in 0.000504 #3, done in 0.001054
Output for 5.5.6
#1, result is 0, done in 0.000333 #2, result is 0, done in 0.000315 #3, done in 0.000654
Output for 5.5.5
#1, result is 0, done in 0.000464 #2, result is 0, done in 0.000448 #3, done in 0.000926
Output for 5.5.4
#1, result is 0, done in 0.000396 #2, result is 0, done in 0.000385 #3, done in 0.000803
Output for 5.5.3
#1, result is 0, done in 0.000514 #2, result is 0, done in 0.000494 #3, done in 0.001036
Output for 5.5.2
#1, result is 0, done in 0.000396 #2, result is 0, done in 0.000375 #3, done in 0.000780
Output for 5.5.1
#1, result is 0, done in 0.000468 #2, result is 0, done in 0.000449 #3, done in 0.000935
Output for 5.5.0
#1, result is 0, done in 0.000409 #2, result is 0, done in 0.000400 #3, done in 0.000834
Output for 5.4.45
#1, result is 0, done in 0.000489 #2, result is 0, done in 0.000475 #3, done in 0.001020
Output for 5.4.44
#1, result is 0, done in 0.000518 #2, result is 0, done in 0.000489 #3, done in 0.001019
Output for 5.4.43
#1, result is 0, done in 0.000444 #2, result is 0, done in 0.000425 #3, done in 0.000880
Output for 5.4.42
#1, result is 0, done in 0.000345 #2, result is 0, done in 0.000328 #3, done in 0.000685
Output for 5.4.41
#1, result is 0, done in 0.000343 #2, result is 0, done in 0.000357 #3, done in 0.000756
Output for 5.4.40
#1, result is 0, done in 0.000390 #2, result is 0, done in 0.000394 #3, done in 0.000829
Output for 5.4.39
#1, result is 0, done in 0.000467 #2, result is 0, done in 0.000449 #3, done in 0.000840
Output for 5.4.38
#1, result is 0, done in 0.000355 #2, result is 0, done in 0.000351 #3, done in 0.000725
Output for 5.4.37
#1, result is 0, done in 0.000528 #2, result is 0, done in 0.000490 #3, done in 0.001032
Output for 5.4.36
#1, result is 0, done in 0.000542 #2, result is 0, done in 0.000578 #3, done in 0.001213
Output for 5.4.35
#1, result is 0, done in 0.000510 #2, result is 0, done in 0.000489 #3, done in 0.001012
Output for 5.4.34
#1, result is 0, done in 0.000514 #2, result is 0, done in 0.000486 #3, done in 0.001009
Output for 5.4.32
#1, result is 0, done in 0.000513 #2, result is 0, done in 0.000487 #3, done in 0.001018
Output for 5.4.31
#1, result is 0, done in 0.000431 #2, result is 0, done in 0.000409 #3, done in 0.000851
Output for 5.4.30
#1, result is 0, done in 0.000474 #2, result is 0, done in 0.000454 #3, done in 0.000946
Output for 5.4.29
#1, result is 0, done in 0.000429 #2, result is 0, done in 0.000414 #3, done in 0.000864
Output for 5.4.28
#1, result is 0, done in 0.000513 #2, result is 0, done in 0.000498 #3, done in 0.001033
Output for 5.4.27
#1, result is 0, done in 0.000537 #2, result is 0, done in 0.000504 #3, done in 0.001053
Output for 5.4.26
#1, result is 0, done in 0.000401 #2, result is 0, done in 0.000379 #3, done in 0.000794
Output for 5.4.25
#1, result is 0, done in 0.000425 #2, result is 0, done in 0.000406 #3, done in 0.000854
Output for 5.4.24
#1, result is 0, done in 0.000466 #2, result is 0, done in 0.000455 #3, done in 0.000949
Output for 5.4.23
#1, result is 0, done in 0.000510 #2, result is 0, done in 0.000505 #3, done in 0.001043
Output for 5.4.22
#1, result is 0, done in 0.000531 #2, result is 0, done in 0.000495 #3, done in 0.001035
Output for 5.4.21
#1, result is 0, done in 0.000493 #2, result is 0, done in 0.000444 #3, done in 0.000924
Output for 5.4.20
#1, result is 0, done in 0.000346 #2, result is 0, done in 0.000396 #3, done in 0.000789
Output for 5.4.19
#1, result is 0, done in 0.000410 #2, result is 0, done in 0.000385 #3, done in 0.000800
Output for 5.4.18
#1, result is 0, done in 0.000364 #2, result is 0, done in 0.000348 #3, done in 0.000721
Output for 5.4.17
#1, result is 0, done in 0.000514 #2, result is 0, done in 0.000492 #3, done in 0.001019
Output for 5.4.16
#1, result is 0, done in 0.000428 #2, result is 0, done in 0.000412 #3, done in 0.000849
Output for 5.4.15
#1, result is 0, done in 0.000515 #2, result is 0, done in 0.000487 #3, done in 0.001021
Output for 5.4.14
#1, result is 0, done in 0.000747 #2, result is 0, done in 0.000704 #3, done in 0.001463
Output for 5.4.13
#1, result is 0, done in 0.000515 #2, result is 0, done in 0.000501 #3, done in 0.001032
Output for 5.4.12
#1, result is 0, done in 0.000496 #2, result is 0, done in 0.000471 #3, done in 0.000973
Output for 5.4.11
#1, result is 0, done in 0.000633 #2, result is 0, done in 0.000607 #3, done in 0.001256
Output for 5.4.10
#1, result is 0, done in 0.000481 #2, result is 0, done in 0.000444 #3, done in 0.000955
Output for 5.4.9
#1, result is 0, done in 0.000322 #2, result is 0, done in 0.000295 #3, done in 0.000636
Output for 5.4.8
#1, result is 0, done in 0.000344 #2, result is 0, done in 0.000298 #3, done in 0.000652
Output for 5.4.7
#1, result is 0, done in 0.000342 #2, result is 0, done in 0.000313 #3, done in 0.000642
Output for 5.4.6
#1, result is 0, done in 0.000333 #2, result is 0, done in 0.000316 #3, done in 0.000701
Output for 5.4.5
#1, result is 0, done in 0.000277 #2, result is 0, done in 0.000260 #3, done in 0.000549
Output for 5.4.4
#1, result is 0, done in 0.000310 #2, result is 0, done in 0.000296 #3, done in 0.000615
Output for 5.4.3
#1, result is 0, done in 0.000310 #2, result is 0, done in 0.000300 #3, done in 0.000619
Output for 5.4.2
#1, result is 0, done in 0.000462 #2, result is 0, done in 0.000468 #3, done in 0.000952
Output for 5.4.1
#1, result is 0, done in 0.000509 #2, result is 0, done in 0.000499 #3, done in 0.001026
Output for 5.4.0
#1, result is 0, done in 0.000524 #2, result is 0, done in 0.000501 #3, done in 0.001031
Output for 5.3.29
#1, result is 0, done in 0.000480 #2, result is 0, done in 0.000489 #3, done in 0.001030
Output for 5.3.28
#1, result is 0, done in 0.000437 #2, result is 0, done in 0.000424 #3, done in 0.000868
Output for 5.3.27
#1, result is 0, done in 0.000517 #2, result is 0, done in 0.000469 #3, done in 0.000968
Output for 5.3.26
#1, result is 0, done in 0.000489 #2, result is 0, done in 0.000465 #3, done in 0.000966
Output for 5.3.25
#1, result is 0, done in 0.000534 #2, result is 0, done in 0.000516 #3, done in 0.001063
Output for 5.3.24
#1, result is 0, done in 0.000509 #2, result is 0, done in 0.000485 #3, done in 0.001002
Output for 5.3.23
#1, result is 0, done in 0.000375 #2, result is 0, done in 0.000353 #3, done in 0.000739
Output for 5.3.22
#1, result is 0, done in 0.000556 #2, result is 0, done in 0.000485 #3, done in 0.001003
Output for 5.3.21
#1, result is 0, done in 0.000445 #2, result is 0, done in 0.000445 #3, done in 0.000907
Output for 5.3.20
#1, result is 0, done in 0.000442 #2, result is 0, done in 0.000420 #3, done in 0.000877
Output for 5.3.19
#1, result is 0, done in 0.000322 #2, result is 0, done in 0.000306 #3, done in 0.000634
Output for 5.3.18
#1, result is 0, done in 0.000327 #2, result is 0, done in 0.000316 #3, done in 0.000673
Output for 5.3.17
#1, result is 0, done in 0.000327 #2, result is 0, done in 0.000312 #3, done in 0.000647
Output for 5.3.16
#1, result is 0, done in 0.000337 #2, result is 0, done in 0.000308 #3, done in 0.000647
Output for 5.3.15
#1, result is 0, done in 0.000342 #2, result is 0, done in 0.000328 #3, done in 0.000681
Output for 5.3.14
#1, result is 0, done in 0.000326 #2, result is 0, done in 0.000311 #3, done in 0.000645
Output for 5.3.13
#1, result is 0, done in 0.000332 #2, result is 0, done in 0.000309 #3, done in 0.000649
Output for 5.3.12
#1, result is 0, done in 0.000328 #2, result is 0, done in 0.000307 #3, done in 0.000595
Output for 5.3.11
#1, result is 0, done in 0.000324 #2, result is 0, done in 0.000323 #3, done in 0.000660
Output for 5.3.10
#1, result is 0, done in 0.000324 #2, result is 0, done in 0.000308 #3, done in 0.000638
Output for 5.3.9
#1, result is 0, done in 0.000417 #2, result is 0, done in 0.000402 #3, done in 0.000834
Output for 5.3.8
#1, result is 0, done in 0.000313 #2, result is 0, done in 0.000314 #3, done in 0.000646
Output for 5.3.7
#1, result is 0, done in 0.000313 #2, result is 0, done in 0.000313 #3, done in 0.000648
Output for 5.3.6
#1, result is 0, done in 0.000356 #2, result is 0, done in 0.000355 #3, done in 0.000722
Output for 5.3.5
#1, result is 0, done in 0.000313 #2, result is 0, done in 0.000301 #3, done in 0.000617
Output for 5.3.4
#1, result is 0, done in 0.000461 #2, result is 0, done in 0.000403 #3, done in 0.000858
Output for 5.3.3
#1, result is 0, done in 0.000318 #2, result is 0, done in 0.000301 #3, done in 0.000625
Output for 5.3.2
#1, result is 0, done in 0.000293 #2, result is 0, done in 0.000289 #3, done in 0.000579
Output for 5.3.1
#1, result is 0, done in 0.000286 #2, result is 0, done in 0.000278 #3, done in 0.000602
Output for 5.3.0
#1, result is 0, done in 0.000260 #2, result is 0, done in 0.000256 #3, done in 0.000544
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/eLEPp on line 23
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 T_FUNCTION in /in/eLEPp on line 23
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/eLEPp on line 23
Process exited with code 255.