3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /* How many times the code under test should run in each function */ define('LOOP',100); function f1(&$md5) { $path = NULL; $yy = date('y'); $ab = substr($md5, 0, 2); $cd = substr($md5, 2, 2); for($i=0; $i<LOOP; ++$i) { $path = 'some' . '/'; $path .= $yy . '/'; $path .= $ab . '/'; $path .= $cd . '/'; } } function f2(&$md5) { $path = NULL; $yy = date('y'); $ab = substr($md5, 0, 2); $cd = substr($md5, 2, 2); for($i=0; $i<LOOP; ++$i) { $path = sprintf('%s/%s/%s/%s', 'some', $yy, $ab, $cd); } } $md5 = md5(str_shuffle('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')); $start = microtime(true); f1($md5); $stop = microtime(true); $time1 = $stop - $start; $start = microtime(true); f2($md5); $stop = microtime(true); $time2 = $stop - $start; echo $time1 . "\t"; echo $time2 . "\n";
based on qm3UQ
Output for 7.1.0
3.7908554077148E-5 2.5033950805664E-5
Output for 7.0.14
3.9100646972656E-5 2.598762512207E-5
Output for 7.0.10
4.8160552978516E-5 2.0980834960938E-5
Output for 7.0.9
2.9087066650391E-5 1.2874603271484E-5
Output for 7.0.8
4.2200088500977E-5 1.9073486328125E-5
Output for 7.0.7
4.1961669921875E-5 2.0027160644531E-5
Output for 7.0.6
3.1948089599609E-5 1.3113021850586E-5
Output for 7.0.5
3.6001205444336E-5 1.8119812011719E-5
Output for 7.0.4
3.0040740966797E-5 1.4781951904297E-5
Output for 7.0.3
3.1948089599609E-5 1.6927719116211E-5
Output for 7.0.2
2.7894973754883E-5 1.4066696166992E-5
Output for 7.0.1
3.6001205444336E-5 1.9073486328125E-5
Output for 7.0.0
4.0054321289062E-5 2.0980834960938E-5
Output for 5.6.28
7.2956085205078E-5 8.2969665527344E-5
Output for 5.6.25
4.6014785766602E-5 4.7206878662109E-5
Output for 5.6.24
3.8862228393555E-5 4.1007995605469E-5
Output for 5.6.23
4.6014785766602E-5 4.8160552978516E-5
Output for 5.6.22
4.7206878662109E-5 4.7922134399414E-5
Output for 5.6.21
4.2915344238281E-5 5.6982040405273E-5
Output for 5.6.20
5.4836273193359E-5 5.6982040405273E-5
Output for 5.6.19
8.0108642578125E-5 0.00010204315185547
Output for 5.6.18
5.1021575927734E-5 5.1975250244141E-5
Output for 5.6.17
4.1007995605469E-5 4.9114227294922E-5
Output for 5.6.16
7.2002410888672E-5 9.2029571533203E-5
Output for 5.6.15
5.5074691772461E-5 6.103515625E-5
Output for 5.6.14
6.103515625E-5 6.103515625E-5
Output for 5.6.13
6.7949295043945E-5 5.6982040405273E-5
Output for 5.6.12
5.2928924560547E-5 5.5074691772461E-5
Output for 5.6.11
5.5074691772461E-5 5.9127807617188E-5
Output for 5.6.10
5.6028366088867E-5 7.1048736572266E-5
Output for 5.6.9
4.1007995605469E-5 4.1961669921875E-5
Output for 5.6.8
5.5789947509766E-5 5.9843063354492E-5
Output for 5.6.7
4.6968460083008E-5 4.6014785766602E-5
Output for 5.6.6
4.6014785766602E-5 4.9114227294922E-5
Output for 5.6.5
5.1021575927734E-5 5.5074691772461E-5
Output for 5.6.4
4.2915344238281E-5 4.6014785766602E-5
Output for 5.6.3
6.9141387939453E-5 8.8930130004883E-5
Output for 5.6.2
4.3153762817383E-5 4.6014785766602E-5
Output for 5.4.26, 5.6.1
4.7922134399414E-5 5.2928924560547E-5
Output for 5.6.0
4.57763671875E-5 4.9829483032227E-5
Output for 5.5.38
6.0081481933594E-5 8.6069107055664E-5
Output for 5.5.5, 5.5.37
4.887580871582E-5 5.5074691772461E-5
Output for 5.5.36
4.7922134399414E-5 5.4121017456055E-5
Output for 5.5.35
5.3882598876953E-5 5.9127807617188E-5
Output for 5.5.34
4.6968460083008E-5 4.887580871582E-5
Output for 5.5.33
5.0067901611328E-5 5.8174133300781E-5
Output for 5.5.32
8.7976455688477E-5 0.0001060962677002
Output for 5.5.31
4.887580871582E-5 5.6028366088867E-5
Output for 5.5.30
5.793571472168E-5 6.3896179199219E-5
Output for 5.5.29
8.7976455688477E-5 0.00011706352233887
Output for 5.5.28
4.4107437133789E-5 4.7922134399414E-5
Output for 5.5.27
4.7922134399414E-5 5.0067901611328E-5
Output for 5.5.26
5.6982040405273E-5 5.8889389038086E-5
Output for 5.5.25
5.793571472168E-5 6.2942504882812E-5
Output for 5.5.24
8.4877014160156E-5 0.00010204315185547
Output for 5.5.23
4.8160552978516E-5 5.6982040405273E-5
Output for 5.4.15, 5.5.22
5.0067901611328E-5 5.5074691772461E-5
Output for 5.5.21
3.504753112793E-5 3.6954879760742E-5
Output for 5.5.20
3.3140182495117E-5 3.7908554077148E-5
Output for 5.4.34, 5.5.1, 5.5.19
5.1021575927734E-5 5.6982040405273E-5
Output for 5.5.18
5.1021575927734E-5 5.8174133300781E-5
Output for 5.4.17, 5.5.16
4.6014785766602E-5 5.0067901611328E-5
Output for 5.5.15
5.0067901611328E-5 5.6982040405273E-5
Output for 5.5.14
4.1961669921875E-5 4.6014785766602E-5
Output for 5.5.13
3.9100646972656E-5 5.1021575927734E-5
Output for 5.3.23, 5.5.12
4.9114227294922E-5 5.6982040405273E-5
Output for 5.5.11
8.2969665527344E-5 6.6995620727539E-5
Output for 5.5.10
3.4809112548828E-5 6.6995620727539E-5
Output for 5.5.9
5.5074691772461E-5 6.4849853515625E-5
Output for 5.5.8
4.3869018554688E-5 5.3167343139648E-5
Output for 5.5.7
5.5074691772461E-5 6.5088272094727E-5
Output for 5.5.6
5.6982040405273E-5 6.3896179199219E-5
Output for 5.5.4
6.413459777832E-5 8.702278137207E-5
Output for 5.5.3
4.1007995605469E-5 4.6968460083008E-5
Output for 5.5.2
4.4107437133789E-5 4.887580871582E-5
Output for 5.5.0
5.4121017456055E-5 8.5115432739258E-5
Output for 5.4.36, 5.4.45
4.1961669921875E-5 4.5061111450195E-5
Output for 5.4.44
5.793571472168E-5 7.319450378418E-5
Output for 5.4.43
4.6968460083008E-5 3.9815902709961E-5
Output for 5.4.42
5.2928924560547E-5 6.103515625E-5
Output for 5.4.41
5.4121017456055E-5 5.793571472168E-5
Output for 5.4.40
3.8862228393555E-5 4.1961669921875E-5
Output for 5.4.39
4.9114227294922E-5 5.2928924560547E-5
Output for 5.4.38
3.814697265625E-5 6.7949295043945E-5
Output for 5.4.37
4.4822692871094E-5 4.9829483032227E-5
Output for 5.4.20, 5.4.35
3.6001205444336E-5 3.9100646972656E-5
Output for 5.4.32
4.7206878662109E-5 5.2928924560547E-5
Output for 5.4.31
5.0067901611328E-5 5.6028366088867E-5
Output for 5.4.30
5.1975250244141E-5 6.103515625E-5
Output for 5.4.29
5.3167343139648E-5 5.9843063354492E-5
Output for 5.4.28
4.4107437133789E-5 5.1021575927734E-5
Output for 5.4.27
5.1975250244141E-5 5.6982040405273E-5
Output for 5.4.25
5.1975250244141E-5 5.9127807617188E-5
Output for 5.4.24
4.8160552978516E-5 5.6028366088867E-5
Output for 5.4.23
4.6968460083008E-5 5.4121017456055E-5
Output for 5.4.22
5.4121017456055E-5 6.103515625E-5
Output for 5.4.21
3.6001205444336E-5 4.1007995605469E-5
Output for 5.4.19
3.3140182495117E-5 3.6954879760742E-5
Output for 5.4.18
5.793571472168E-5 7.2002410888672E-5
Output for 5.4.16
5.1975250244141E-5 5.793571472168E-5
Output for 5.4.14
4.6968460083008E-5 5.2928924560547E-5
Output for 5.4.13
5.1021575927734E-5 7.0095062255859E-5
Output for 5.4.12
6.1988830566406E-5 8.392333984375E-5
Output for 5.4.11
3.504753112793E-5 7.0095062255859E-5
Output for 5.4.10
3.6954879760742E-5 4.4107437133789E-5
Output for 5.4.9
4.3869018554688E-5 3.9100646972656E-5
Output for 5.4.8
5.8174133300781E-5 8.2015991210938E-5
Output for 5.4.7
3.3855438232422E-5 3.7193298339844E-5
Output for 5.4.6
3.3855438232422E-5 3.814697265625E-5
Output for 5.4.5
2.8848648071289E-5 4.9114227294922E-5
Output for 5.4.4
7.0095062255859E-5 9.8943710327148E-5
Output for 5.4.3
3.3855438232422E-5 3.6954879760742E-5
Output for 5.4.2
3.504753112793E-5 3.814697265625E-5
Output for 5.4.1
3.9100646972656E-5 3.0994415283203E-5
Output for 5.4.0
5.6028366088867E-5 4.887580871582E-5
Output for 5.3.29
5.3882598876953E-5 6.8187713623047E-5
Output for 5.3.28
3.6954879760742E-5 4.3869018554688E-5
Output for 5.3.27
5.6982040405273E-5 7.1048736572266E-5
Output for 5.3.26
5.5074691772461E-5 6.7949295043945E-5
Output for 5.3.25
6.0081481933594E-5 7.4863433837891E-5
Output for 5.3.24
5.4121017456055E-5 6.7949295043945E-5
Output for 5.3.22
5.5074691772461E-5 6.6995620727539E-5
Output for 5.3.21
4.2915344238281E-5 5.1021575927734E-5
Output for 5.3.20
4.1961669921875E-5 5.1021575927734E-5
Output for 5.3.19
4.4107437133789E-5 6.0081481933594E-5
Output for 5.3.18
3.6954879760742E-5 4.2915344238281E-5
Output for 5.3.17
3.8862228393555E-5 4.2915344238281E-5
Output for 5.3.16
3.6001205444336E-5 4.3869018554688E-5
Output for 5.3.15
3.7908554077148E-5 4.2915344238281E-5
Output for 5.3.0, 5.3.14
3.814697265625E-5 4.2915344238281E-5
Output for 5.3.5, 5.3.10, 5.3.13
3.6001205444336E-5 4.3153762817383E-5
Output for 5.3.12
5.1975250244141E-5 5.8889389038086E-5
Output for 5.3.11
3.6001205444336E-5 4.1961669921875E-5
Output for 5.3.9
3.6954879760742E-5 4.3153762817383E-5
Output for 5.3.8
5.1975250244141E-5 6.6995620727539E-5
Output for 5.3.7
4.3153762817383E-5 5.2928924560547E-5
Output for 5.2.9, 5.2.16, 5.3.6
3.7908554077148E-5 4.5061111450195E-5
Output for 5.3.4
3.504753112793E-5 4.1961669921875E-5
Output for 5.3.3
4.6968460083008E-5 6.103515625E-5
Output for 5.3.2
4.6014785766602E-5 4.7922134399414E-5
Output for 5.3.1
4.8160552978516E-5 6.5088272094727E-5
Output for 5.2.17
7.2002410888672E-5 7.2956085205078E-5
Output for 5.2.15
4.3869018554688E-5 5.3882598876953E-5
Output for 5.2.14
3.8862228393555E-5 4.3869018554688E-5
Output for 5.2.13
3.7908554077148E-5 4.4107437133789E-5
Output for 5.2.12
3.1948089599609E-5 6.1988830566406E-5
Output for 5.2.11
3.7908554077148E-5 4.3869018554688E-5
Output for 5.2.10
4.0054321289062E-5 4.6968460083008E-5
Output for 5.2.8
3.0994415283203E-5 3.6001205444336E-5
Output for 5.2.7
3.814697265625E-5 4.5061111450195E-5
Output for 5.2.6
3.9100646972656E-5 4.3869018554688E-5
Output for 5.2.5
3.1948089599609E-5 3.814697265625E-5
Output for 5.2.4
5.0067901611328E-5 4.1961669921875E-5
Output for 5.2.3
4.2915344238281E-5 4.9829483032227E-5
Output for 5.2.2
4.1961669921875E-5 3.7908554077148E-5
Output for 5.2.1
3.1948089599609E-05 3.6954879760742E-05
Output for 5.2.0
4.0054321289062E-05 7.6055526733398E-05
Output for 5.1.6
4.6968460083008E-05 5.1975250244141E-05
Output for 5.1.5
5.3167343139648E-05 5.6028366088867E-05
Output for 5.1.4
4.8160552978516E-05 5.1975250244141E-05
Output for 5.1.3
4.0054321289062E-05 5.3882598876953E-05
Output for 5.1.2
3.9100646972656E-05 4.2915344238281E-05
Output for 5.1.1
8.0108642578125E-05 8.8930130004883E-05
Output for 5.1.0
5.4836273193359E-05 6.1988830566406E-05
Output for 5.0.5
6.9856643676758E-05 7.2002410888672E-05
Output for 5.0.4
6.0081481933594E-05 6.4849853515625E-05
Output for 5.0.3
0.00010395050048828 0.00011587142944336
Output for 5.0.2
0.00011920928955078 0.00013494491577148
Output for 5.0.1
0.0001370906829834 0.0001521110534668
Output for 5.0.0
0.00011610984802246 0.00011992454528809
Output for 4.4.9
7.4E-05 6.5E-05
Output for 4.4.8
7.1E-05 6.8E-05
Output for 4.4.7
8.4E-05 8E-05
Output for 4.4.6
6.7E-05 6.7E-05
Output for 4.4.5
6.6E-05 6.4E-05
Output for 4.4.4
7.2E-05 6.5E-05
Output for 4.4.3
6.7E-05 5.5E-05
Output for 4.4.2
8E-05 7.5E-05
Output for 4.4.1
9.6E-05 9E-05
Output for 4.4.0
0.000109 7.7E-05
Output for 4.3.11
0.000138 0.000133
Output for 4.3.10
0.000149 0.000142
Output for 4.3.9
0.000132 0.000128
Output for 4.3.8
0.000107 0.000101
Output for 4.3.7
0.000154 0.000147
Output for 4.3.6
0.000142 0.000133
Output for 4.3.5
9E-05 8.3E-05
Output for 4.3.4
0.000143 0.0001
Output for 4.3.3
0.00013 9.1E-05
Output for 4.3.2
0.000152 8.7E-05
Output for 4.3.1
0.00011 9.2E-05
Output for 4.3.0
0.000127 8.9E-05