run code in 150+ php & hhvm versions
Bugs & Features
<?php $test = function($p = 'abcde', $c = 'abc') { return substr($p, 0, strlen($c)) == $c; }; $test1 = function($p = 'abcde', $c = 'abc') { return strncmp($p, $c, strlen($c)); }; $print = function($closure, $s, $cycles = 100) { for ($i =0; $i < $cycles; $i++) { $closure(); } echo printf('Runns: %s', microtime(1) - $s); echo PHP_EOL; }; $print($test, microtime(1)); $print($test1, microtime(1));
Output for 7.1.0RC3
Runns: 8.8214874267578E-625 Runns: 9.0599060058594E-625
Output for 7.0.6
Runns: 1.6927719116211E-525 Runns: 2.7894973754883E-525
Output for 7.0.5
Runns: 1.1920928955078E-525 Runns: 1.0967254638672E-525
Output for 7.0.4
Runns: 1.0967254638672E-525 Runns: 1.215934753418E-524
Output for 7.0.3
Runns: 1.6927719116211E-525 Runns: 1.5020370483398E-525
Output for 7.0.2
Runns: 1.0967254638672E-525 Runns: 1.0967254638672E-525
Output for 7.0.1
Runns: 1.4066696166992E-525 Runns: 1.4066696166992E-525
Output for 7.0.0
Runns: 1.0967254638672E-525 Runns: 1.6927719116211E-525
Output for hhvm-3.12.0
Runns: 4.0054321289062E-525 Runns: 2.6941299438477E-525
Output for hhvm-3.10.0
Runns: 8.2969665527344E-525 Runns: 5.2928924560547E-525
Output for 5.6.21
Runns: 0.0001010894775390626 Runns: 8.4161758422852E-525
Output for 5.6.20
Runns: 4.2915344238281E-525 Runns: 4.2915344238281E-525
Output for 5.6.19
Runns: 5.6028366088867E-525 Runns: 6.1988830566406E-525
Output for 5.6.18
Runns: 3.6954879760742E-525 Runns: 2.9087066650391E-525
Output for 5.6.17
Runns: 6.3180923461914E-525 Runns: 6.1988830566406E-525
Output for 5.6.16
Runns: 5.6028366088867E-525 Runns: 4.5061111450195E-525
Output for 5.6.15
Runns: 6.0796737670898E-525 Runns: 5.8889389038086E-525
Output for 5.6.14
Runns: 4.2915344238281E-525 Runns: 3.504753112793E-524
Output for 5.6.13
Runns: 4.1007995605469E-525 Runns: 3.2901763916016E-525
Output for 5.6.12
Runns: 6.8187713623047E-525 Runns: 5.4836273193359E-525
Output for 5.6.11
Runns: 8.8930130004883E-525 Runns: 4.4107437133789E-525
Output for 5.6.10
Runns: 9.3936920166016E-525 Runns: 0.000106096267700225
Output for 5.6.9
Runns: 0.0001080036163330126 Runns: 7.1048736572266E-525
Output for 5.6.8
Runns: 9.1075897216797E-525 Runns: 7.4148178100586E-525
Output for 5.5.35
Runns: 5.1021575927734E-525 Runns: 4.0054321289062E-525
Output for 5.5.34
Runns: 6.2942504882812E-525 Runns: 5.1021575927734E-525
Output for 5.5.33
Runns: 3.8862228393555E-525 Runns: 2.9087066650391E-525
Output for 5.5.32
Runns: 5.9127807617188E-525 Runns: 4.9114227294922E-525
Output for 5.5.31
Runns: 6.0081481933594E-525 Runns: 6.1988830566406E-525
Output for 5.5.30
Runns: 4.7922134399414E-525 Runns: 3.8862228393555E-525
Output for 5.5.29
Runns: 8.9168548583984E-525 Runns: 8.4877014160156E-525
Output for 5.5.28
Runns: 6.8187713623047E-525 Runns: 5.6028366088867E-525
Output for 5.5.27
Runns: 4.2915344238281E-525 Runns: 3.6001205444336E-525
Output for 5.5.24, 5.5.26
Runns: 4.6014785766602E-525 Runns: 3.504753112793E-524
Output for 5.5.25
Runns: 6.103515625E-521 Runns: 6.2227249145508E-525
Output for 5.4.45
Runns: 7.3909759521484E-525 Runns: 6.0081481933594E-525
Output for 5.3.23, 5.4.44
Runns: 6.5088272094727E-525 Runns: 5.3882598876953E-525
Output for 5.4.43
Runns: 6.6995620727539E-525 Runns: 7.7962875366211E-525
Output for 5.4.42
Runns: 6.7949295043945E-525 Runns: 9.0837478637695E-525
Output for 5.4.41
Runns: 0.0001008510589599626 Runns: 5.1975250244141E-525
Output for 5.4.40
Runns: 0.0001130104064941426 Runns: 9.7036361694336E-525
Output for 5.4.39
Runns: 7.0095062255859E-525 Runns: 5.6028366088867E-525
Output for 5.4.38
Runns: 7.9870223999023E-525 Runns: 5.6982040405273E-525
Output for 5.4.37
Runns: 8.702278137207E-524 Runns: 5.2928924560547E-525
Output for 5.4.36
Runns: 7.0810317993164E-525 Runns: 5.2928924560547E-525
Output for 5.4.35
Runns: 6.7949295043945E-525 Runns: 8.2969665527344E-525
Output for 5.4.34
Runns: 9.3936920166016E-525 Runns: 5.3882598876953E-525
Output for 5.4.32
Runns: 4.5061111450195E-525 Runns: 3.7908554077148E-525
Output for 5.4.31
Runns: 4.887580871582E-524 Runns: 8.4877014160156E-525
Output for 5.4.30
Runns: 9.608268737793E-524 Runns: 4.0054321289062E-525
Output for 5.4.29
Runns: 6.413459777832E-524 Runns: 8.4161758422852E-525
Output for 5.4.28
Runns: 4.7922134399414E-525 Runns: 4.0054321289062E-525
Output for 5.4.27
Runns: 4.9829483032227E-525 Runns: 3.7908554077148E-525
Output for 5.4.26
Runns: 4.7922134399414E-525 Runns: 3.7908554077148E-525
Output for 5.4.25
Runns: 5.0067901611328E-525 Runns: 6.0081481933594E-525
Output for 5.4.24
Runns: 6.2942504882812E-525 Runns: 5.2928924560547E-525
Output for 5.4.23
Runns: 4.8160552978516E-525 Runns: 3.9100646972656E-525
Output for 5.4.22
Runns: 4.6968460083008E-525 Runns: 4.0054321289062E-525
Output for 5.4.21
Runns: 4.6014785766602E-525 Runns: 3.814697265625E-524
Output for 5.4.20
Runns: 4.7206878662109E-525 Runns: 3.9100646972656E-525
Output for 5.4.19
Runns: 5.5074691772461E-525 Runns: 5.6028366088867E-525
Output for 5.4.18
Runns: 5.5789947509766E-525 Runns: 4.6014785766602E-525
Output for 5.4.17
Runns: 0.0001008510589599626 Runns: 8.0108642578125E-525
Output for 5.4.16
Runns: 8.1062316894531E-525 Runns: 7.1048736572266E-525
Output for 5.4.15
Runns: 5.9843063354492E-525 Runns: 4.4822692871094E-525
Output for 5.4.14
Runns: 5.2928924560547E-525 Runns: 4.3869018554688E-525
Output for 5.4.13
Runns: 5.5074691772461E-525 Runns: 6.0081481933594E-525
Output for 5.4.12
Runns: 5.6982040405273E-525 Runns: 4.3153762817383E-525
Output for 5.4.11
Runns: 5.6028366088867E-525 Runns: 4.3869018554688E-525
Output for 5.4.10
Runns: 5.3167343139648E-525 Runns: 4.3153762817383E-525
Output for 5.4.9
Runns: 6.7949295043945E-525 Runns: 4.2200088500977E-525
Output for 5.4.8
Runns: 5.793571472168E-524 Runns: 4.6014785766602E-525
Output for 5.4.7
Runns: 5.6028366088867E-525 Runns: 6.3896179199219E-525
Output for 5.4.6
Runns: 8.6069107055664E-525 Runns: 5.8174133300781E-525
Output for 5.4.5
Runns: 5.9127807617188E-525 Runns: 4.5061111450195E-525
Output for 5.4.4
Runns: 6.1988830566406E-525 Runns: 4.4107437133789E-525
Output for 5.4.3
Runns: 6.103515625E-521 Runns: 4.6014785766602E-525
Output for 5.4.2
Runns: 5.4121017456055E-525 Runns: 4.4107437133789E-525
Output for 5.4.1
Runns: 5.9127807617188E-525 Runns: 4.6014785766602E-525
Output for 5.4.0
Runns: 5.3882598876953E-525 Runns: 4.3869018554688E-525
Output for 5.3.29
Runns: 5.4121017456055E-525 Runns: 4.57763671875E-523
Output for 5.3.28
Runns: 0.0001049041748046926 Runns: 4.6968460083008E-525
Output for 5.3.27
Runns: 0.0001051425933837926 Runns: 8.8930130004883E-525
Output for 5.3.26
Runns: 6.3180923461914E-525 Runns: 6.5803527832031E-525
Output for 5.3.25
Runns: 6.3896179199219E-525 Runns: 5.5789947509766E-525
Output for 5.3.24
Runns: 0.000122070312522 Runns: 6.2942504882812E-525
Output for 5.3.22
Runns: 6.0796737670898E-525 Runns: 5.2213668823242E-525
Output for 5.3.21
Runns: 6.6041946411133E-525 Runns: 6.2942504882812E-525
Output for 5.3.20
Runns: 6.6041946411133E-525 Runns: 5.2928924560547E-525
Output for 5.3.19
Runns: 6.4849853515625E-525 Runns: 5.4836273193359E-525
Output for 5.3.18
Runns: 6.3896179199219E-525 Runns: 5.2928924560547E-525
Output for 5.3.17
Runns: 6.9141387939453E-525 Runns: 7.2002410888672E-525
Output for 5.3.16
Runns: 0.06029319763183624 Runns: 5.5074691772461E-525
Output for 5.3.15
Runns: 7.2956085205078E-525 Runns: 5.6982040405273E-525
Output for 5.3.14
Runns: 0.0001161098480224626 Runns: 0.0001230239868164126
Output for 5.3.13
Runns: 6.6041946411133E-525 Runns: 7.4863433837891E-525
Output for 5.3.12
Runns: 6.4849853515625E-525 Runns: 7.2002410888672E-525
Output for 5.3.11
Runns: 6.5088272094727E-525 Runns: 5.5074691772461E-525
Output for 5.3.10
Runns: 6.5803527832031E-525 Runns: 5.4836273193359E-525
Output for 5.3.9
Runns: 6.5088272094727E-525 Runns: 6.8902969360352E-525
Output for 5.3.8
Runns: 6.8902969360352E-525 Runns: 6.7234039306641E-525
Output for 5.3.3, 5.3.7
Runns: 6.1988830566406E-525 Runns: 5.1975250244141E-525
Output for 5.3.6
Runns: 6.6041946411133E-525 Runns: 5.2213668823242E-525
Output for 5.3.5
Runns: 8.2969665527344E-525 Runns: 5.5789947509766E-525
Output for 5.3.4
Runns: 6.6041946411133E-525 Runns: 5.1021575927734E-525
Output for 5.3.2
Runns: 6.5803527832031E-525 Runns: 5.0067901611328E-525
Output for 5.3.1
Runns: 6.6041946411133E-525 Runns: 5.4121017456055E-525
Output for 5.3.0
Runns: 5.9843063354492E-525 Runns: 5.1021575927734E-525
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/KjmHu on line 3
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/KjmHu on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/KjmHu on line 3
Process exited with code 255.