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); } TestEmpty(); echo "\n\n"; TestEmpty2(); echo "\n\n"; TestEmpty3(); echo "\n\n"; TestEmpty4();
Output for 7.1.0
5.0067901611328E-5 2.6941299438477E-5 6.6041946411133E-5 9.0837478637695E-5
Output for 7.0.14
4.6014785766602E-5 2.5033950805664E-5 6.1988830566406E-5 8.6069107055664E-5
Output for 7.0.6
4.0054321289062E-5 2.5033950805664E-5 5.3882598876953E-5 7.2002410888672E-5
Output for 7.0.5
3.6001205444336E-5 2.4080276489258E-5 4.1007995605469E-5 5.6028366088867E-5
Output for 7.0.4
3.8862228393555E-5 2.6941299438477E-5 4.6968460083008E-5 6.413459777832E-5
Output for 7.0.3
3.1948089599609E-5 2.1934509277344E-5 3.9100646972656E-5 5.1975250244141E-5
Output for 7.0.2
4.4107437133789E-5 3.6954879760742E-5 5.6028366088867E-5 7.0095062255859E-5
Output for 7.0.1
3.0040740966797E-5 1.8835067749023E-5 3.7908554077148E-5 4.6968460083008E-5
Output for 7.0.0
4.7922134399414E-5 3.0040740966797E-5 6.6995620727539E-5 8.2015991210938E-5
Output for hhvm-3.12.0
0.00012898445129395 0.00017809867858887 0.00019693374633789 0.00018692016601562
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
9.4890594482422E-5 7.2002410888672E-5 0.00016283988952637 0.0001521110534668
Output for 5.6.21
8.702278137207E-5 7.1048736572266E-5 0.00014591217041016 0.00013899803161621
Output for 5.6.20
7.6055526733398E-5 6.2942504882812E-5 0.00012803077697754 0.00012111663818359
Output for 5.6.19
5.6028366088867E-5 4.6014785766602E-5 9.2983245849609E-5 8.8930130004883E-5
Output for 5.6.18
6.9141387939453E-5 6.5088272094727E-5 0.00012683868408203 0.00011801719665527
Output for 5.6.17
7.5101852416992E-5 7.1048736572266E-5 0.00012803077697754 0.00011897087097168
Output for 5.6.16
5.1021575927734E-5 4.2200088500977E-5 8.702278137207E-5 8.1062316894531E-5
Output for 5.6.15
5.4121017456055E-5 4.4107437133789E-5 0.00010514259338379 9.1075897216797E-5
Output for 5.6.14
8.702278137207E-5 8.392333984375E-5 0.00017595291137695 0.00014901161193848
Output for 5.6.13
6.6041946411133E-5 5.5074691772461E-5 0.00010085105895996 9.3936920166016E-5
Output for 5.6.12
8.702278137207E-5 7.1048736572266E-5 0.00014686584472656 0.0001380443572998
Output for 5.6.11
5.1021575927734E-5 4.6968460083008E-5 9.2029571533203E-5 8.0108642578125E-5
Output for 5.6.10
8.2969665527344E-5 6.8187713623047E-5 0.00014996528625488 0.00014686584472656
Output for 5.6.9
5.1021575927734E-5 4.0769577026367E-5 8.6069107055664E-5 8.0108642578125E-5
Output for 5.6.8
8.2015991210938E-5 6.7949295043945E-5 0.00013899803161621 0.00013017654418945
Output for 5.6.7
5.3882598876953E-5 4.2915344238281E-5 9.1075897216797E-5 8.4161758422852E-5
Output for 5.5.35
6.6995620727539E-5 6.9141387939453E-5 0.00011992454528809 0.00012302398681641
Output for 5.5.34
5.6028366088867E-5 4.3869018554688E-5 9.1075897216797E-5 8.4877014160156E-5
Output for 5.5.33
5.2928924560547E-5 4.2915344238281E-5 0.00010800361633301 8.2969665527344E-5
Output for 5.5.32
8.2015991210938E-5 6.7949295043945E-5 0.00014209747314453 0.00012993812561035
Output for 5.5.31
5.5074691772461E-5 7.1048736572266E-5 0.00010299682617188 0.0001220703125
Output for 5.5.30
5.3167343139648E-5 4.2915344238281E-5 0.00010085105895996 8.6069107055664E-5
Output for 5.5.29
5.793571472168E-5 5.4121017456055E-5 0.00010299682617188 9.5129013061523E-5
Output for 5.5.28
6.1988830566406E-5 5.1975250244141E-5 0.00011515617370605 0.00010204315185547
Output for 5.5.27
0.00010514259338379 8.702278137207E-5 0.0001220703125 0.00013995170593262
Output for 5.5.26
0.00011301040649414 8.392333984375E-5 0.00011801719665527 0.00011992454528809
Output for 5.5.25
5.2928924560547E-5 4.4107437133789E-5 9.3936920166016E-5 8.4877014160156E-5
Output for 5.5.24
0.00010895729064941 8.7976455688477E-5 0.00018191337585449 0.00017309188842773
Output for 5.4.45
8.8930130004883E-5 6.103515625E-5 0.00013589859008789 0.00013208389282227
Output for 5.4.44
0.00013089179992676 0.00016880035400391 0.00032806396484375 0.00038599967956543
Output for 5.4.43
0.00012016296386719 0.00010800361633301 0.00016689300537109 0.00016307830810547
Output for 5.4.42
7.7009201049805E-5 8.392333984375E-5 0.00025701522827148 0.00018692016601562
Output for 5.4.41
7.7009201049805E-5 6.103515625E-5 0.00011992454528809 0.00011420249938965
Output for 5.4.40
7.9154968261719E-5 8.2015991210938E-5 0.0001678466796875 0.00017595291137695
Output for 5.4.39
0.00015401840209961 0.00016999244689941 0.00029993057250977 0.00036001205444336
Output for 5.4.38
0.00012397766113281 9.2029571533203E-5 0.00022697448730469 0.00021004676818848
Output for 5.4.37
0.00011301040649414 0.00013494491577148 0.00034022331237793 0.00032711029052734
Output for 5.4.36
0.00011992454528809 0.0001988410949707 0.00034308433532715 0.00032401084899902
Output for 5.4.35
0.00011181831359863 8.702278137207E-5 0.00019693374633789 0.00028491020202637
Output for 5.4.34
9.9897384643555E-5 8.0108642578125E-5 0.00015592575073242 0.00013899803161621
Output for 5.4.32
6.7949295043945E-5 6.5088272094727E-5 0.00010299682617188 0.00011801719665527
Output for 5.4.31
5.3167343139648E-5 4.4107437133789E-5 0.00011205673217773 8.2015991210938E-5
Output for 5.4.30
5.2928924560547E-5 5.1975250244141E-5 9.8943710327148E-5 0.00012588500976562
Output for 5.4.29
5.2928924560547E-5 4.2915344238281E-5 0.00012993812561035 0.0001060962677002
Output for 5.4.28
0.00012707710266113 7.3909759521484E-5 0.00015997886657715 0.00015592575073242
Output for 5.4.27
9.4175338745117E-5 9.2029571533203E-5 0.00023698806762695 0.00025296211242676
Output for 5.4.26
9.7990036010742E-5 9.918212890625E-5 0.00018405914306641 0.00017309188842773
Output for 5.4.25
0.00010895729064941 7.9870223999023E-5 0.00021696090698242 0.00019216537475586
Output for 5.4.24
0.00011610984802246 8.8930130004883E-5 0.00026702880859375 0.00020098686218262
Output for 5.4.23
8.9883804321289E-5 9.3936920166016E-5 0.0003058910369873 0.00019502639770508
Output for 5.4.22
9.7990036010742E-5 9.6797943115234E-5 0.0002291202545166 0.0003049373626709
Output for 5.4.21
0.00016093254089355 9.7990036010742E-5 0.00023889541625977 0.00020980834960938
Output for 5.4.20
9.1075897216797E-5 9.918212890625E-5 0.00023102760314941 0.00022292137145996
Output for 5.4.19
9.7990036010742E-5 0.00010395050048828 0.00020599365234375 0.00036215782165527
Output for 5.4.18
0.00010204315185547 0.00010085105895996 0.00018095970153809 0.00023102760314941
Output for 5.4.17
9.608268737793E-5 8.082389831543E-5 0.00024914741516113 0.00023794174194336
Output for 5.4.16
9.8943710327148E-5 9.608268737793E-5 0.00024294853210449 0.00021195411682129
Output for 5.4.15
9.4890594482422E-5 8.8930130004883E-5 0.00018715858459473 0.00021505355834961
Output for 5.4.14
0.00012707710266113 7.2002410888672E-5 0.00017595291137695 0.00017714500427246
Output for 5.4.13
9.2029571533203E-5 7.1048736572266E-5 0.00018906593322754 0.00020503997802734
Output for 5.4.12
8.6069107055664E-5 0.00065493583679199 0.00020980834960938 0.00015687942504883
Output for 5.4.11
9.7036361694336E-5 9.6797943115234E-5 0.00026512145996094 0.00020694732666016
Output for 5.4.10
9.8943710327148E-5 7.9870223999023E-5 0.00021982192993164 0.00017499923706055
Output for 5.4.9
9.9897384643555E-5 8.4161758422852E-5 0.00022292137145996 0.00017786026000977
Output for 5.4.8
0.00013089179992676 0.00029802322387695 0.0003659725189209 0.00023102760314941
Output for 5.4.7
9.7990036010742E-5 0.00021100044250488 0.00032615661621094 0.0002589225769043
Output for 5.4.6
9.5129013061523E-5 0.00011086463928223 0.01136302947998 0.00016403198242188
Output for 5.4.5
0.00010013580322266 8.0108642578125E-5 0.00019311904907227 0.00040102005004883
Output for 5.4.4
9.8943710327148E-5 7.9154968261719E-5 0.00027704238891602 0.00016283988952637
Output for 5.4.3
8.5115432739258E-5 6.8187713623047E-5 0.00017881393432617 0.0002598762512207
Output for 5.4.2
9.7036361694336E-5 8.1062316894531E-5 0.00021100044250488 0.00033307075500488
Output for 5.4.1
0.00010395050048828 8.9883804321289E-5 0.0002291202545166 0.00037002563476562
Output for 5.4.0
0.00010108947753906 8.1062316894531E-5 0.00018906593322754 0.00017595291137695
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/29Odg 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/29Odg on line 46
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/29Odg on line 46
Process exited with code 255.