3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $isset = true; $array = array(); $notSetArray = array(0=>''); $string = ''; // Test Source function TestEmpty() { $array = null; $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { !empty($array); ++$i; } echo (microtime(true) - $t); } function TestEmpty2() { $array = null; $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { (! $array ); ++$i; } echo (microtime(true) - $t); } function TestEmpty3() { $array = null; $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { ($array != []); ++$i; } echo (microtime(true) - $t); } function TestEmpty4() { $array = null; $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { ($array != false); ++$i; } echo (microtime(true) - $t); } TestEmpty(); echo "\n\n"; TestEmpty2(); echo "\n\n"; TestEmpty3(); echo "\n\n"; echo TestEmpty4();
Output for 7.1.0
4.9829483032227E-5 4.7922134399414E-5 7.1048736572266E-5 3.0040740966797E-5
Output for 7.0.14
4.5061111450195E-5 2.5033950805664E-5 6.1988830566406E-5 2.5033950805664E-5
Output for 7.0.6
4.1007995605469E-5 2.5033950805664E-5 5.6028366088867E-5 2.6941299438477E-5
Output for 7.0.5
5.4121017456055E-5 3.6001205444336E-5 6.1988830566406E-5 3.504753112793E-5
Output for 7.0.4
3.0040740966797E-5 2.0980834960938E-5 3.504753112793E-5 2.0027160644531E-5
Output for 7.0.3
6.2942504882812E-5 3.4093856811523E-5 5.4836273193359E-5 2.9087066650391E-5
Output for 7.0.2
3.504753112793E-5 2.4080276489258E-5 4.1961669921875E-5 2.288818359375E-5
Output for 7.0.1
4.1961669921875E-5 2.6941299438477E-5 5.2928924560547E-5 2.5033950805664E-5
Output for 7.0.0
4.8160552978516E-5 3.0994415283203E-5 5.8174133300781E-5 3.0994415283203E-5
Output for 5.6.28
0.00013399124145508 8.0108642578125E-5 0.000244140625 8.8214874267578E-5
Output for 5.6.21
8.8930130004883E-5 6.3896179199219E-5 0.00016212463378906 7.1048736572266E-5
Output for 5.6.20
5.2928924560547E-5 5.6028366088867E-5 9.0837478637695E-5 4.887580871582E-5
Output for 5.6.19
8.0108642578125E-5 6.5088272094727E-5 0.00013303756713867 7.0810317993164E-5
Output for 5.6.18
7.4148178100586E-5 5.8889389038086E-5 0.00012397766113281 6.5088272094727E-5
Output for 5.6.17
7.2002410888672E-5 5.9127807617188E-5 0.0001220703125 6.6041946411133E-5
Output for 5.6.16
9.8943710327148E-5 4.1961669921875E-5 0.00010395050048828 5.5074691772461E-5
Output for 5.6.15
8.6069107055664E-5 6.9856643676758E-5 0.00014710426330566 7.7962875366211E-5
Output for 5.6.14
6.9856643676758E-5 5.6982040405273E-5 0.00011992454528809 6.2942504882812E-5
Output for 5.6.13
7.9870223999023E-5 8.8930130004883E-5 0.00013494491577148 7.1048736572266E-5
Output for 5.6.12
6.3180923461914E-5 5.793571472168E-5 0.00011014938354492 6.0081481933594E-5
Output for 5.6.11
5.1021575927734E-5 5.4121017456055E-5 0.00014305114746094 4.6014785766602E-5
Output for 5.6.10
7.8916549682617E-5 6.413459777832E-5 0.00013279914855957 7.1048736572266E-5
Output for 5.6.9
5.8174133300781E-5 4.7922134399414E-5 9.6797943115234E-5 5.1975250244141E-5
Output for 5.6.8
7.0095062255859E-5 5.6982040405273E-5 0.00011706352233887 6.7949295043945E-5
Output for 5.6.7
5.4121017456055E-5 4.1961669921875E-5 8.8930130004883E-5 4.887580871582E-5
Output for 5.5.35
7.7962875366211E-5 6.4849853515625E-5 0.00013399124145508 7.2956085205078E-5
Output for 5.5.34
5.1975250244141E-5 4.3153762817383E-5 8.9168548583984E-5 4.6968460083008E-5
Output for 5.5.33
8.2015991210938E-5 6.6995620727539E-5 0.00014281272888184 7.3909759521484E-5
Output for 5.5.32
7.5817108154297E-5 6.1988830566406E-5 0.00013113021850586 6.8187713623047E-5
Output for 5.5.31
5.1975250244141E-5 4.4822692871094E-5 9.2029571533203E-5 4.8160552978516E-5
Output for 5.5.30
5.1975250244141E-5 4.2915344238281E-5 8.9168548583984E-5 4.7922134399414E-5
Output for 5.5.29
5.9127807617188E-5 4.9829483032227E-5 0.00011396408081055 5.6982040405273E-5
Output for 5.5.28
5.3167343139648E-5 4.3153762817383E-5 8.9883804321289E-5 4.6968460083008E-5
Output for 5.5.27
5.793571472168E-5 4.6968460083008E-5 9.7990036010742E-5 7.1048736572266E-5
Output for 5.5.26
7.7962875366211E-5 7.4148178100586E-5 0.00014495849609375 7.5101852416992E-5
Output for 5.5.25
8.2015991210938E-5 6.6995620727539E-5 0.00013995170593262 7.4863433837891E-5
Output for 5.5.24
7.8201293945312E-5 7.7009201049805E-5 0.0001380443572998 7.3909759521484E-5
Output for 5.4.45
7.7009201049805E-5 5.9843063354492E-5 0.00012111663818359 6.5088272094727E-5
Output for 5.4.44
0.00011301040649414 9.1791152954102E-5 0.00023412704467773 0.00010013580322266
Output for 5.4.43
0.00015902519226074 7.8916549682617E-5 0.00024104118347168 8.5115432739258E-5
Output for 5.4.42
9.0122222900391E-5 6.9856643676758E-5 0.00014090538024902 0.00010490417480469
Output for 5.4.41
0.00011014938354492 8.9883804321289E-5 0.00020980834960938 0.00010490417480469
Output for 5.4.40
0.00011110305786133 6.103515625E-5 0.00012016296386719 6.5088272094727E-5
Output for 5.4.39
0.00015997886657715 0.0001218318939209 0.00028109550476074 0.00013589859008789
Output for 5.4.38
7.9870223999023E-5 0.00014209747314453 0.00027108192443848 0.00014996528625488
Output for 5.4.37
8.7976455688477E-5 9.1075897216797E-5 0.00018596649169922 9.5844268798828E-5
Output for 5.4.36
7.4863433837891E-5 9.2029571533203E-5 0.00017499923706055 8.5115432739258E-5
Output for 5.4.35
7.5817108154297E-5 6.1988830566406E-5 0.00012493133544922 7.7962875366211E-5
Output for 5.4.34
7.5101852416992E-5 5.8889389038086E-5 0.00012302398681641 6.5088272094727E-5
Output for 5.4.32
6.5088272094727E-5 8.5115432739258E-5 0.00027608871459961 8.8930130004883E-5
Output for 5.4.31
6.4849853515625E-5 3.504753112793E-5 9.0122222900391E-5 4.1007995605469E-5
Output for 5.4.30
6.8902969360352E-5 6.1988830566406E-5 0.00010395050048828 0.00018787384033203
Output for 5.4.29
0.00014400482177734 9.4890594482422E-5 0.00022292137145996 0.00012803077697754
Output for 5.4.28
8.9883804321289E-5 8.2015991210938E-5 0.00016307830810547 8.2015991210938E-5
Output for 5.4.27
0.00013089179992676 6.8902969360352E-5 0.00020194053649902 9.608268737793E-5
Output for 5.4.26
8.6069107055664E-5 6.8902969360352E-5 0.00016093254089355 8.2015991210938E-5
Output for 5.4.25
5.5789947509766E-5 4.3869018554688E-5 0.00010800361633301 6.0081481933594E-5
Output for 5.4.24
0.00011777877807617 0.00011706352233887 0.0002739429473877 0.00010180473327637
Output for 5.4.23
5.6028366088867E-5 4.3869018554688E-5 0.00010299682617188 6.0796737670898E-5
Output for 5.4.22
9.2983245849609E-5 7.9870223999023E-5 0.0001978874206543 8.7976455688477E-5
Output for 5.4.21
0.00014305114746094 7.7009201049805E-5 0.00018501281738281 8.6784362792969E-5
Output for 5.4.20
0.00012612342834473 9.0122222900391E-5 0.00023412704467773 9.7036361694336E-5
Output for 5.4.19
0.00012898445129395 9.9897384643555E-5 0.00017094612121582 8.2015991210938E-5
Output for 5.4.18
5.5074691772461E-5 7.2956085205078E-5 0.0001060962677002 5.0067901611328E-5
Output for 5.4.17
0.00012898445129395 8.8930130004883E-5 0.00024795532226562 0.00010514259338379
Output for 5.4.16
9.1075897216797E-5 7.2002410888672E-5 0.00022387504577637 8.2969665527344E-5
Output for 5.4.15
9.2029571533203E-5 7.2956085205078E-5 0.00019311904907227 8.8930130004883E-5
Output for 5.4.14
8.392333984375E-5 9.0837478637695E-5 0.0066351890563965 8.9168548583984E-5
Output for 5.4.13
9.1791152954102E-5 7.0095062255859E-5 0.00018095970153809 8.4877014160156E-5
Output for 5.4.12
0.00010108947753906 9.7990036010742E-5 0.00024604797363281 0.0001070499420166
Output for 5.4.11
0.00012612342834473 7.6055526733398E-5 0.00017809867858887 0.00010800361633301
Output for 5.4.10
8.9883804321289E-5 6.6995620727539E-5 0.00016689300537109 7.9870223999023E-5
Output for 5.4.9
9.5844268798828E-5 0.00016188621520996 0.00024700164794922 0.0001070499420166
Output for 5.4.8
0.00011992454528809 9.8943710327148E-5 0.00028705596923828 0.00010991096496582
Output for 5.4.7
6.6041946411133E-5 4.3869018554688E-5 0.00010180473327637 4.9114227294922E-5
Output for 5.4.6
7.8916549682617E-5 6.103515625E-5 0.00012397766113281 7.4863433837891E-5
Output for 5.4.5
5.5074691772461E-5 5.9843063354492E-5 0.00010919570922852 6.9141387939453E-5
Output for 5.4.4
6.7949295043945E-5 4.6968460083008E-5 0.00012707710266113 7.3909759521484E-5
Output for 5.4.3
9.8943710327148E-5 7.9154968261719E-5 0.00019502639770508 0.00012803077697754
Output for 5.4.2
9.8943710327148E-5 7.8916549682617E-5 0.0001978874206543 9.0837478637695E-5
Output for 5.4.1
5.3882598876953E-5 5.3167343139648E-5 0.00011801719665527 8.5115432739258E-5
Output for 5.4.0
5.5074691772461E-5 4.9114227294922E-5 0.00011897087097168 5.9127807617188E-5
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/edhDW on line 46
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/edhDW on line 46
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/edhDW on line 46
Process exited with code 255.