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"; TestEmpty4();
Output for 7.1.0
5.0067901611328E-5 3.6954879760742E-5 7.0810317993164E-5 2.9802322387695E-5
Output for 7.0.14
4.3869018554688E-5 2.288818359375E-5 6.5088272094727E-5 2.288818359375E-5
Output for 7.0.6
3.3140182495117E-5 2.598762512207E-5 4.8160552978516E-5 2.3126602172852E-5
Output for 7.0.5
3.1948089599609E-5 2.5033950805664E-5 3.814697265625E-5 2.0980834960938E-5
Output for 7.0.4
4.6014785766602E-5 3.1948089599609E-5 5.4121017456055E-5 3.7908554077148E-5
Output for 7.0.3
4.5061111450195E-5 3.0994415283203E-5 5.3882598876953E-5 3.0040740966797E-5
Output for 7.0.2
4.4107437133789E-5 2.8848648071289E-5 5.0067901611328E-5 2.8848648071289E-5
Output for 7.0.1
4.6014785766602E-5 2.9087066650391E-5 5.6028366088867E-5 2.9087066650391E-5
Output for 7.0.0
4.7922134399414E-5 3.0994415283203E-5 5.8174133300781E-5 3.0994415283203E-5
Output for 5.6.28
9.5844268798828E-5 7.9870223999023E-5 0.00015997886657715 8.1062316894531E-5
Output for 5.6.21
8.2015991210938E-5 6.6995620727539E-5 0.00013995170593262 7.4148178100586E-5
Output for 5.6.20
9.1075897216797E-5 7.2956085205078E-5 0.00013995170593262 7.5101852416992E-5
Output for 5.6.19
5.3167343139648E-5 5.1975250244141E-5 9.0837478637695E-5 4.7922134399414E-5
Output for 5.6.18
6.5803527832031E-5 7.2956085205078E-5 0.00012493133544922 6.3180923461914E-5
Output for 5.6.17
8.2015991210938E-5 6.5803527832031E-5 0.00017714500427246 6.6995620727539E-5
Output for 5.6.16
5.4121017456055E-5 4.5061111450195E-5 9.2029571533203E-5 4.887580871582E-5
Output for 5.6.15
5.1975250244141E-5 4.2915344238281E-5 8.8930130004883E-5 4.6968460083008E-5
Output for 5.6.14
6.0081481933594E-5 5.793571472168E-5 0.00010395050048828 5.6982040405273E-5
Output for 5.6.13
8.2969665527344E-5 8.2015991210938E-5 0.00014400482177734 7.7009201049805E-5
Output for 5.6.12
6.3896179199219E-5 5.6028366088867E-5 0.00011801719665527 6.0796737670898E-5
Output for 5.6.11
7.9154968261719E-5 7.6055526733398E-5 0.00013899803161621 7.3909759521484E-5
Output for 5.6.10
7.2956085205078E-5 5.9127807617188E-5 0.00012302398681641 6.4849853515625E-5
Output for 5.6.9
5.2928924560547E-5 4.2915344238281E-5 8.8930130004883E-5 4.8160552978516E-5
Output for 5.6.8
6.1988830566406E-5 5.0067901611328E-5 0.00011301040649414 5.5789947509766E-5
Output for 5.5.35
8.2015991210938E-5 6.7949295043945E-5 0.00014114379882812 0.00010395050048828
Output for 5.5.34
8.2015991210938E-5 6.7949295043945E-5 0.00013995170593262 8.6069107055664E-5
Output for 5.5.33
5.1975250244141E-5 4.4107437133789E-5 9.1075897216797E-5 4.7922134399414E-5
Output for 5.5.32
5.2928924560547E-5 4.9829483032227E-5 8.9883804321289E-5 6.1988830566406E-5
Output for 5.5.31
8.1062316894531E-5 7.319450378418E-5 0.00014495849609375 7.6055526733398E-5
Output for 5.5.30
6.3896179199219E-5 4.887580871582E-5 0.0001070499420166 5.3882598876953E-5
Output for 5.5.29
5.1975250244141E-5 4.2915344238281E-5 0.00010085105895996 4.7922134399414E-5
Output for 5.5.28
5.4121017456055E-5 5.2928924560547E-5 9.3936920166016E-5 4.9829483032227E-5
Output for 5.5.27
7.2956085205078E-5 5.8889389038086E-5 0.00012111663818359 6.5088272094727E-5
Output for 5.5.26
9.9897384643555E-5 8.4161758422852E-5 0.00014090538024902 9.2983245849609E-5
Output for 5.5.25
8.4877014160156E-5 6.7949295043945E-5 0.00013995170593262 7.5101852416992E-5
Output for 5.5.24
4.4822692871094E-5 3.504753112793E-5 8.7976455688477E-5 3.9100646972656E-5
Output for 5.4.45
6.7949295043945E-5 5.2928924560547E-5 0.0001227855682373 6.3896179199219E-5
Output for 5.4.44
4.6014785766602E-5 3.7908554077148E-5 7.7962875366211E-5 3.9100646972656E-5
Output for 5.4.43
9.2983245849609E-5 8.2015991210938E-5 0.00019001960754395 8.6069107055664E-5
Output for 5.4.42
6.7949295043945E-5 5.6982040405273E-5 0.00026798248291016 6.6041946411133E-5
Output for 5.4.41
4.3869018554688E-5 3.504753112793E-5 7.2956085205078E-5 3.7908554077148E-5
Output for 5.4.40
5.8889389038086E-5 4.8160552978516E-5 0.00011110305786133 5.1975250244141E-5
Output for 5.4.39
7.3909759521484E-5 5.8889389038086E-5 0.00011682510375977 6.3896179199219E-5
Output for 5.4.38
9.8943710327148E-5 5.9127807617188E-5 0.00014495849609375 7.9154968261719E-5
Output for 5.4.37
7.4863433837891E-5 5.9127807617188E-5 0.00012588500976562 6.6041946411133E-5
Output for 5.4.36
7.6055526733398E-5 5.9127807617188E-5 0.0001220703125 6.6041946411133E-5
Output for 5.4.35
0.00011801719665527 0.00019598007202148 0.00030016899108887 0.00020098686218262
Output for 5.4.34
0.00013089179992676 8.2015991210938E-5 0.0002140998840332 0.00010800361633301
Output for 5.4.32
5.5074691772461E-5 4.4107437133789E-5 0.00017905235290527 5.8174133300781E-5
Output for 5.4.31
5.3882598876953E-5 4.3869018554688E-5 0.00018596649169922 6.9141387939453E-5
Output for 5.4.30
6.3896179199219E-5 4.2915344238281E-5 0.00010800361633301 4.7922134399414E-5
Output for 5.4.29
6.4849853515625E-5 4.3869018554688E-5 0.00011491775512695 4.887580871582E-5
Output for 5.4.28
9.1075897216797E-5 7.3909759521484E-5 0.00020289421081543 8.0108642578125E-5
Output for 5.4.27
0.00010108947753906 9.8943710327148E-5 0.00025296211242676 0.00010895729064941
Output for 5.4.26
5.6028366088867E-5 4.6014785766602E-5 0.00017905235290527 6.103515625E-5
Output for 5.4.25
8.2969665527344E-5 7.6055526733398E-5 0.0001530647277832 7.4148178100586E-5
Output for 5.4.24
0.00011801719665527 0.00010895729064941 0.00029706954956055 7.3909759521484E-5
Output for 5.4.23
9.2983245849609E-5 0.0001070499420166 0.00015091896057129 8.3208084106445E-5
Output for 5.4.22
8.9168548583984E-5 0.00010991096496582 0.0002739429473877 0.00011301040649414
Output for 5.4.21
9.2029571533203E-5 8.1062316894531E-5 0.00026106834411621 0.00011110305786133
Output for 5.4.20
9.3936920166016E-5 7.6055526733398E-5 0.00018095970153809 9.2029571533203E-5
Output for 5.4.19
5.793571472168E-5 7.6055526733398E-5 9.2029571533203E-5 4.887580871582E-5
Output for 5.4.18
0.00010490417480469 0.00010895729064941 0.00018692016601562 8.8930130004883E-5
Output for 5.4.17
0.00010204315185547 0.00010299682617188 0.00023913383483887 0.0001070499420166
Output for 5.4.16
5.5074691772461E-5 5.1021575927734E-5 0.00012016296386719 5.0067901611328E-5
Output for 5.4.15
5.6982040405273E-5 4.57763671875E-5 9.2029571533203E-5 5.0067901611328E-5
Output for 5.4.14
9.0837478637695E-5 9.0837478637695E-5 0.00023484230041504 0.00010299682617188
Output for 5.4.13
9.608268737793E-5 7.6055526733398E-5 0.00018906593322754 9.2029571533203E-5
Output for 5.4.12
5.6028366088867E-5 4.887580871582E-5 0.00012588500976562 6.7949295043945E-5
Output for 5.4.11
5.9843063354492E-5 7.1048736572266E-5 0.0001218318939209 6.6041946411133E-5
Output for 5.4.10
5.5074691772461E-5 4.7922134399414E-5 0.00010395050048828 6.1988830566406E-5
Output for 5.4.9
0.00010108947753906 0.00010108947753906 0.00019502639770508 8.9883804321289E-5
Output for 5.4.8
0.00012016296386719 7.9870223999023E-5 0.00020289421081543 8.392333984375E-5
Output for 5.4.7
0.00013399124145508 9.3936920166016E-5 0.00025200843811035 0.00010490417480469
Output for 5.4.6
9.8943710327148E-5 8.1062316894531E-5 0.00022697448730469 0.00020098686218262
Output for 5.4.5
9.2029571533203E-5 7.4863433837891E-5 0.00026607513427734 8.3208084106445E-5
Output for 5.4.4
9.7990036010742E-5 7.8916549682617E-5 0.00018787384033203 8.7976455688477E-5
Output for 5.4.3
0.00017404556274414 7.4148178100586E-5 0.00018882751464844 0.00010919570922852
Output for 5.4.2
9.2983245849609E-5 7.7962875366211E-5 0.00018692016601562 8.5830688476562E-5
Output for 5.4.1
9.608268737793E-5 7.9870223999023E-5 0.00018906593322754 0.00029897689819336
Output for 5.4.0
8.5830688476562E-5 4.0054321289062E-5 0.00010800361633301 8.5115432739258E-5
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/fYoL8 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/fYoL8 on line 46
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/fYoL8 on line 46
Process exited with code 255.