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)$array === $array); ++$i; } echo (microtime(true) - $t); } function TestEmpty5() { $array = null; $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { ((array)$array === $array); ++$i; } echo (microtime(true) - $t); } TestEmpty(); echo "\n\n"; TestEmpty2(); echo "\n\n"; TestEmpty3(); echo "\n\n"; TestEmpty4(); echo "\n\n"; TestEmpty5();
Output for 7.1.0
5.0067901611328E-5 3.6001205444336E-5 7.1048736572266E-5 9.2983245849609E-5 9.2029571533203E-5
Output for 7.0.14
4.4107437133789E-5 2.3126602172852E-5 6.0081481933594E-5 8.082389831543E-5 8.1062316894531E-5
Output for 7.0.11
4.2200088500977E-5 2.4080276489258E-5 5.793571472168E-5 8.2969665527344E-5 8.2969665527344E-5
Output for 7.0.10
3.3855438232422E-5 1.8119812011719E-5 4.4107437133789E-5 6.5088272094727E-5 6.413459777832E-5
Output for 7.0.9
3.3140182495117E-5 1.8835067749023E-5 5.6028366088867E-5 7.2956085205078E-5 6.5088272094727E-5
Output for 7.0.8
2.7894973754883E-5 1.6212463378906E-5 4.1007995605469E-5 5.1021575927734E-5 4.9829483032227E-5
Output for 7.0.7
3.6001205444336E-5 2.0027160644531E-5 4.9114227294922E-5 6.6995620727539E-5 6.6041946411133E-5
Output for 7.0.6
4.6014785766602E-5 2.7894973754883E-5 5.8889389038086E-5 7.9154968261719E-5 8.7976455688477E-5
Output for 7.0.5
5.0067901611328E-5 3.2901763916016E-5 5.5074691772461E-5 7.7009201049805E-5 7.3909759521484E-5
Output for 7.0.4
5.6028366088867E-5 3.2901763916016E-5 5.6982040405273E-5 7.5817108154297E-5 7.7009201049805E-5
Output for 7.0.3
5.0067901611328E-5 3.0040740966797E-5 5.4121017456055E-5 7.9870223999023E-5 7.8916549682617E-5
Output for 7.0.2
4.2200088500977E-5 3.3855438232422E-5 5.5074691772461E-5 7.2002410888672E-5 7.2002410888672E-5
Output for 7.0.1
4.3153762817383E-5 2.598762512207E-5 5.6982040405273E-5 7.7009201049805E-5 7.5101852416992E-5
Output for 7.0.0
3.1948089599609E-5 1.9073486328125E-5 3.6954879760742E-5 5.1021575927734E-5 5.1975250244141E-5
Output for hhvm-3.13.2
0.00012707710266113 0.00011086463928223 0.00014686584472656 0.00014901161193848 0.00014805793762207
Output for hhvm-3.12.0
0.00013089179992676 0.00015497207641602 0.00022482872009277 0.00017595291137695 0.00033187866210938
Output for hhvm-3.10.0
0.00019621849060059 0.00024080276489258 0.00037002563476562 0.00036716461181641 0.00034809112548828
Output for 5.6.28
8.8930130004883E-5 7.2002410888672E-5 0.00016283988952637 0.00015807151794434 0.00014591217041016
Output for 5.6.26
8.7976455688477E-5 7.2002410888672E-5 0.00014495849609375 0.00013589859008789 0.00013518333435059
Output for 5.6.25
8.8214874267578E-5 7.1048736572266E-5 0.00014591217041016 0.0001380443572998 0.00013494491577148
Output for 5.6.24
5.4121017456055E-5 4.5061111450195E-5 9.7990036010742E-5 8.702278137207E-5 8.4877014160156E-5
Output for 5.6.23
6.3896179199219E-5 5.1975250244141E-5 0.00010418891906738 9.8943710327148E-5 9.7990036010742E-5
Output for 5.6.22
8.4161758422852E-5 7.7962875366211E-5 0.00014305114746094 0.00013279914855957 0.00014495849609375
Output for 5.6.21
8.392333984375E-5 6.9141387939453E-5 0.00014710426330566 0.0001368522644043 0.00013494491577148
Output for 5.6.20
7.6055526733398E-5 8.7976455688477E-5 0.00012397766113281 0.00011515617370605 0.00011515617370605
Output for 5.6.19
8.7976455688477E-5 7.2002410888672E-5 0.00014686584472656 0.0001370906829834 0.00013589859008789
Output for 5.6.18
7.0095062255859E-5 6.6041946411133E-5 0.00015616416931152 0.00011205673217773 0.0001220703125
Output for 5.6.17
8.2969665527344E-5 7.8916549682617E-5 0.00014901161193848 0.00014019012451172 0.00014400482177734
Output for 5.6.16
8.7976455688477E-5 7.2002410888672E-5 0.00014591217041016 0.0001370906829834 0.00013589859008789
Output for 5.6.15
7.0095062255859E-5 6.6995620727539E-5 0.00012111663818359 0.00011301040649414 0.0001220703125
Output for 5.6.14
7.9870223999023E-5 6.4849853515625E-5 0.00013399124145508 0.00012516975402832 0.00012516975402832
Output for 5.6.13
6.7949295043945E-5 7.6055526733398E-5 0.00011396408081055 0.00010800361633301 0.00010800361633301
Output for 5.6.12
8.2015991210938E-5 6.6995620727539E-5 0.00014591217041016 0.00013017654418945 0.00013113021850586
Output for 5.6.11
8.392333984375E-5 6.7234039306641E-5 0.00014090538024902 0.00013208389282227 0.00012993812561035
Output for 5.6.10
7.6055526733398E-5 6.1988830566406E-5 0.00012779235839844 0.00012707710266113 0.00011897087097168
Output for 5.6.9
6.6041946411133E-5 5.4121017456055E-5 0.00011491775512695 0.0001060962677002 0.00010490417480469
Output for 5.6.8
8.2969665527344E-5 8.392333984375E-5 0.00014400482177734 0.00013399124145508 0.00014114379882812
Output for 5.6.7
7.7962875366211E-5 6.3896179199219E-5 0.00013303756713867 0.00012493133544922 0.00012397766113281
Output for 5.6.6
8.4877014160156E-5 6.5088272094727E-5 0.0001368522644043 0.00012302398681641 0.00012111663818359
Output for 5.6.5
8.2015991210938E-5 7.8916549682617E-5 0.00014305114746094 0.00014209747314453 0.0001528263092041
Output for 5.6.4
9.3936920166016E-5 8.7976455688477E-5 0.00018596649169922 0.00016999244689941 0.00016283988952637
Output for 5.6.3
8.1062316894531E-5 6.5088272094727E-5 0.0001380443572998 0.00012898445129395 0.00012803077697754
Output for 5.6.2
7.8916549682617E-5 6.5088272094727E-5 0.00013399124145508 0.00012397766113281 0.00012397766113281
Output for 5.6.1
5.6028366088867E-5 5.6028366088867E-5 9.7036361694336E-5 9.0837478637695E-5 8.9883804321289E-5
Output for 5.6.0
7.5101852416992E-5 6.5088272094727E-5 0.0001378059387207 0.0001521110534668 0.00012612342834473
Output for 5.5.38
8.392333984375E-5 7.8916549682617E-5 0.00014400482177734 0.00014495849609375 0.00014591217041016
Output for 5.5.37
7.9870223999023E-5 6.6041946411133E-5 0.00013399124145508 0.00012683868408203 0.00012707710266113
Output for 5.5.36
8.7976455688477E-5 7.1048736572266E-5 0.00014805793762207 0.0001380443572998 0.00013589859008789
Output for 5.5.35
7.5101852416992E-5 6.103515625E-5 0.00012898445129395 0.00013208389282227 0.0001220703125
Output for 5.5.34
8.6069107055664E-5 7.1048736572266E-5 0.00014686584472656 0.00013899803161621 0.0001368522644043
Output for 5.5.33
8.5830688476562E-5 8.702278137207E-5 0.00016403198242188 0.00014710426330566 0.00015401840209961
Output for 5.5.32
7.7962875366211E-5 5.1975250244141E-5 9.0122222900391E-5 9.1075897216797E-5 0.00013399124145508
Output for 5.5.31
7.5101852416992E-5 6.1988830566406E-5 0.00012779235839844 0.00011897087097168 0.00013899803161621
Output for 5.5.30
9.5844268798828E-5 7.9870223999023E-5 0.00015401840209961 0.00017189979553223 0.00012898445129395
Output for 5.5.29
7.7962875366211E-5 6.413459777832E-5 0.00013494491577148 0.00012707710266113 0.00012397766113281
Output for 5.5.28
7.7962875366211E-5 7.6055526733398E-5 0.00015783309936523 0.00013399124145508 0.00013184547424316
Output for 5.5.27
6.1988830566406E-5 6.103515625E-5 0.0001070499420166 0.0001068115234375 0.00010395050048828
Output for 5.5.26
7.8916549682617E-5 7.4148178100586E-5 0.00016188621520996 0.00012898445129395 0.0001380443572998
Output for 5.5.25
7.7009201049805E-5 7.2956085205078E-5 0.00013303756713867 0.00012302398681641 0.0001370906829834
Output for 5.5.24
7.7962875366211E-5 6.4849853515625E-5 0.00013399124145508 0.00012588500976562 0.00012493133544922
Output for 5.5.23
6.1988830566406E-5 5.9127807617188E-5 0.0001070499420166 0.00011110305786133 0.00010085105895996
Output for 5.5.22
9.2029571533203E-5 8.7976455688477E-5 0.00016021728515625 0.0001518726348877 0.00015902519226074
Output for 5.5.21
0.00010204315185547 6.3180923461914E-5 0.00011992454528809 0.00010490417480469 8.4877014160156E-5
Output for 5.5.20
8.2969665527344E-5 6.6995620727539E-5 0.00014209747314453 0.00013303756713867 0.00014615058898926
Output for 5.5.19
8.9883804321289E-5 7.4863433837891E-5 0.00015616416931152 0.00014495849609375 0.00014400482177734
Output for 5.5.18
8.5830688476562E-5 8.392333984375E-5 0.00015997886657715 0.00014901161193848 0.00014901161193848
Output for 5.5.16
7.1048736572266E-5 5.5789947509766E-5 0.00011801719665527 0.00010991096496582 0.00010895729064941
Output for 5.5.15
9.2983245849609E-5 7.4863433837891E-5 0.00015497207641602 0.00014710426330566 0.00014495849609375
Output for 5.5.14
8.702278137207E-5 7.2956085205078E-5 0.00015902519226074 0.00014305114746094 0.00014305114746094
Output for 5.5.13
8.082389831543E-5 5.9127807617188E-5 0.00014090538024902 0.00012588500976562 0.00012516975402832
Output for 5.5.12
8.5830688476562E-5 6.6995620727539E-5 0.00013899803161621 0.00013494491577148 0.00012993812561035
Output for 5.5.11
8.7976455688477E-5 7.2002410888672E-5 0.0001521110534668 0.00014090538024902 0.00014114379882812
Output for 5.5.10
8.702278137207E-5 7.0095062255859E-5 0.00016188621520996 0.00014209747314453 0.00014090538024902
Output for 5.5.9
6.1988830566406E-5 5.1021575927734E-5 0.00010800361633301 9.7990036010742E-5 9.7036361694336E-5
Output for 5.5.8
6.9141387939453E-5 6.7949295043945E-5 0.0001220703125 0.00011301040649414 0.00011420249938965
Output for 5.5.7
8.3208084106445E-5 6.6995620727539E-5 0.00013995170593262 0.00013208389282227 0.00012993812561035
Output for 5.5.6
8.9168548583984E-5 8.4877014160156E-5 0.00016188621520996 0.00014305114746094 0.00014901161193848
Output for 5.5.5
7.8916549682617E-5 4.1007995605469E-5 9.0122222900391E-5 8.5115432739258E-5 0.00011420249938965
Output for 5.5.4
5.3167343139648E-5 4.2915344238281E-5 8.8930130004883E-5 8.2969665527344E-5 0.00010108947753906
Output for 5.5.3
6.9141387939453E-5 5.6028366088867E-5 0.00014185905456543 0.00010991096496582 0.00011014938354492
Output for 5.5.2
9.4890594482422E-5 6.7949295043945E-5 0.00013995170593262 0.00013113021850586 0.00012993812561035
Output for 5.5.1
8.6069107055664E-5 7.2002410888672E-5 0.00014686584472656 0.00013899803161621 0.00014710426330566
Output for 5.5.0
6.3896179199219E-5 5.1975250244141E-5 0.00010800361633301 0.00010299682617188 0.00010108947753906
Output for 5.4.45
6.9856643676758E-5 5.9127807617188E-5 0.00012993812561035 0.00011181831359863 0.00011205673217773
Output for 5.4.44
7.2956085205078E-5 6.103515625E-5 0.00012612342834473 0.00011897087097168 0.00011801719665527
Output for 5.4.43
8.4161758422852E-5 7.9154968261719E-5 0.00015592575073242 0.00014185905456543 0.00014209747314453
Output for 5.4.42
8.3208084106445E-5 8.1062316894531E-5 0.00015902519226074 0.00014400482177734 0.00014400482177734
Output for 5.4.41
7.1048736572266E-5 6.8902969360352E-5 0.00012397766113281 0.00011491775512695 0.00012397766113281
Output for 5.4.40
6.1988830566406E-5 5.1021575927734E-5 0.00010800361633301 9.9897384643555E-5 0.0001070499420166
Output for 5.4.39
6.2227249145508E-5 6.2942504882812E-5 0.00010800361633301 0.00010299682617188 0.00011205673217773
Output for 5.4.38
7.5817108154297E-5 7.3909759521484E-5 0.00016593933105469 0.00013494491577148 0.00014400482177734
Output for 5.4.37
7.8916549682617E-5 6.7949295043945E-5 0.00013089179992676 0.00011706352233887 0.00011920928955078
Output for 5.4.36
8.7976455688477E-5 7.5101852416992E-5 0.00014901161193848 0.00014185905456543 0.00014114379882812
Output for 5.4.35
6.5088272094727E-5 5.3882598876953E-5 0.00010991096496582 0.00010299682617188 0.00010204315185547
Output for 5.4.34
7.319450378418E-5 7.6055526733398E-5 0.00012803077697754 0.00013303756713867 0.00013494491577148
Output for 5.4.32
8.0108642578125E-5 6.9141387939453E-5 0.00014996528625488 0.00013613700866699 0.0001368522644043
Output for 5.4.31
7.2956085205078E-5 7.4863433837891E-5 0.00012683868408203 0.00011992454528809 0.00013613700866699
Output for 5.4.30
7.9870223999023E-5 6.6995620727539E-5 0.00014686584472656 0.00012898445129395 0.00012803077697754
Output for 5.4.29
7.3909759521484E-5 6.1988830566406E-5 0.00012493133544922 0.00011801719665527 0.00011682510375977
Output for 5.4.28
8.8930130004883E-5 7.0095062255859E-5 0.00012302398681641 0.00011897087097168 0.00015091896057129
Output for 5.4.27
5.2928924560547E-5 4.5061111450195E-5 8.9168548583984E-5 8.6069107055664E-5 0.00010490417480469
Output for 5.4.26
8.1062316894531E-5 6.3896179199219E-5 0.00012898445129395 0.00012302398681641 0.0001220703125
Output for 5.4.25
0.00010108947753906 8.2969665527344E-5 0.00015592575073242 0.00013494491577148 0.00013303756713867
Output for 5.4.24
8.4877014160156E-5 6.4849853515625E-5 0.00012993812561035 0.00012707710266113 0.00012683868408203
Output for 5.4.23
8.1062316894531E-5 7.8916549682617E-5 0.00013995170593262 0.00013303756713867 0.00014495849609375
Output for 5.4.22
7.6055526733398E-5 6.5088272094727E-5 0.00012898445129395 0.00012397766113281 0.0001218318939209
Output for 5.4.21
8.9883804321289E-5 9.0122222900391E-5 0.00021195411682129 0.0002129077911377 0.00020098686218262
Output for 5.4.20
7.2956085205078E-5 5.6982040405273E-5 0.00011610984802246 0.0001368522644043 0.00013089179992676
Output for 5.4.19
5.7220458984375E-5 6.5088272094727E-5 0.00016307830810547 0.00014305114746094 0.0001380443572998
Output for 5.4.18
8.2015991210938E-5 6.7949295043945E-5 0.00013494491577148 0.00012898445129395 0.00012803077697754
Output for 5.4.17
8.6069107055664E-5 7.1048736572266E-5 0.00014209747314453 0.00014090538024902 0.00013303756713867
Output for 5.4.16
9.0122222900391E-5 7.3909759521484E-5 0.00017118453979492 0.00015091896057129 0.00014209747314453
Output for 5.4.15
7.7009201049805E-5 7.4148178100586E-5 0.00012707710266113 0.00012016296386719 0.0001518726348877
Output for 5.4.14
7.2956085205078E-5 6.1988830566406E-5 0.00012397766113281 0.00011801719665527 0.00011777877807617
Output for 5.4.13
7.9870223999023E-5 6.4849853515625E-5 0.00012898445129395 0.00012302398681641 0.00012087821960449
Output for 5.4.12
8.702278137207E-5 7.7009201049805E-5 0.00014996528625488 0.00014185905456543 0.00014209747314453
Output for 5.4.11
8.0108642578125E-5 7.7962875366211E-5 0.00014781951904297 0.00013899803161621 0.0001380443572998
Output for 5.4.10
8.4161758422852E-5 8.6069107055664E-5 0.00015115737915039 0.00013899803161621 0.0001521110534668
Output for 5.4.9
0.00014305114746094 0.00010204315185547 0.00026583671569824 0.00024700164794922 0.00024890899658203
Output for 5.4.8
7.8916549682617E-5 6.7949295043945E-5 0.00013589859008789 0.00012707710266113 0.00012803077697754
Output for 5.4.7
8.392333984375E-5 7.1048736572266E-5 0.00014090538024902 0.00013399124145508 0.00013208389282227
Output for 5.4.6
8.8930130004883E-5 8.392333984375E-5 0.00016188621520996 0.00014996528625488 0.00015878677368164
Output for 5.4.5
6.9856643676758E-5 5.9127807617188E-5 0.00011801719665527 0.00012087821960449 0.00011086463928223
Output for 5.4.4
8.7976455688477E-5 7.2956085205078E-5 0.00014400482177734 0.00013899803161621 0.0001378059387207
Output for 5.4.3
8.4161758422852E-5 7.1048736572266E-5 0.00014209747314453 0.00013303756713867 0.00013303756713867
Output for 5.4.2
9.0122222900391E-5 7.2002410888672E-5 9.8943710327148E-5 8.8930130004883E-5 9.8943710327148E-5
Output for 5.4.1
7.2956085205078E-5 6.1988830566406E-5 0.00012302398681641 0.00011587142944336 0.00011491775512695
Output for 5.4.0
6.9141387939453E-5 5.8889389038086E-5 0.00011801719665527 0.00011205673217773 0.00011086463928223
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/1r7Xj 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/1r7Xj on line 46
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/1r7Xj on line 46
Process exited with code 255.