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 = array(); $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { (! $array ); ++$i; } echo (microtime(true) - $t); } function TestEmpty3() { $array = array(); $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { ($array !== []); ++$i; } echo (microtime(true) - $t); } TestEmpty(); echo "\n\n"; TestEmpty2(); echo "\n\n"; TestEmpty3();
Output for 7.1.0
3.814697265625E-5 3.4093856811523E-5 6.1988830566406E-5
Output for 7.0.14
4.3869018554688E-5 4.0054321289062E-5 6.8902969360352E-5
Output for 7.0.6
4.1007995605469E-5 3.1948089599609E-5 6.1988830566406E-5
Output for 7.0.5
2.6941299438477E-5 2.598762512207E-5 3.9100646972656E-5
Output for 7.0.4
3.7908554077148E-5 3.9100646972656E-5 6.1988830566406E-5
Output for 7.0.3
3.2901763916016E-5 4.1961669921875E-5 6.103515625E-5
Output for 7.0.2
3.3855438232422E-5 3.2186508178711E-5 5.0067901611328E-5
Output for 7.0.1
7.6055526733398E-5 3.1948089599609E-5 5.2928924560547E-5
Output for 7.0.0
3.6954879760742E-5 3.4093856811523E-5 5.4836273193359E-5
Output for 5.6.28
7.1048736572266E-5 8.2969665527344E-5 0.0001828670501709
Output for 5.6.21
6.6041946411133E-5 8.0108642578125E-5 0.00016093254089355
Output for 5.6.20
0.00012302398681641 0.0001070499420166 0.00023293495178223
Output for 5.6.19
4.0054321289062E-5 4.4107437133789E-5 0.00010299682617188
Output for 5.6.18
6.6995620727539E-5 7.5101852416992E-5 0.00017499923706055
Output for 5.6.17
4.1961669921875E-5 5.4836273193359E-5 0.00010204315185547
Output for 5.6.16
4.1961669921875E-5 4.5061111450195E-5 9.8943710327148E-5
Output for 5.6.15
6.7949295043945E-5 7.4863433837891E-5 0.00016307830810547
Output for 5.6.14
4.6014785766602E-5 5.0067901611328E-5 0.00010585784912109
Output for 5.6.13
6.3180923461914E-5 7.7009201049805E-5 0.00017905235290527
Output for 5.6.12
6.6041946411133E-5 9.7036361694336E-5 0.00014495849609375
Output for 5.6.11
6.7949295043945E-5 8.2015991210938E-5 0.00019097328186035
Output for 5.6.9 - 5.6.10
4.1961669921875E-5 5.5074691772461E-5 0.00010204315185547
Output for 5.6.8
6.5088272094727E-5 7.8916549682617E-5 0.00016617774963379
Output for 5.6.7
4.1961669921875E-5 4.5061111450195E-5 0.0001060962677002
Output for 5.5.35
6.5088272094727E-5 7.2956085205078E-5 0.00015115737915039
Output for 5.5.34
6.0796737670898E-5 6.9856643676758E-5 0.00014615058898926
Output for 5.5.33
6.5088272094727E-5 7.3909759521484E-5 0.0001521110534668
Output for 5.5.32
4.1007995605469E-5 5.5074691772461E-5 0.00014495849609375
Output for 5.5.31
4.3869018554688E-5 6.1988830566406E-5 0.00010514259338379
Output for 5.5.30
6.6041946411133E-5 8.0108642578125E-5 0.0001678466796875
Output for 5.5.29
4.1007995605469E-5 4.6968460083008E-5 9.7036361694336E-5
Output for 5.5.28
5.4121017456055E-5 6.103515625E-5 0.00012898445129395
Output for 5.5.27
7.5101852416992E-5 8.1062316894531E-5 0.00016593933105469
Output for 5.5.26
5.4121017456055E-5 7.2956085205078E-5 0.00013017654418945
Output for 5.5.25
6.3896179199219E-5 7.2956085205078E-5 0.00015091896057129
Output for 5.5.24
5.793571472168E-5 6.413459777832E-5 0.00017189979553223
Output for 5.4.45
6.2227249145508E-5 6.5088272094727E-5 0.00026392936706543
Output for 5.4.44
9.0837478637695E-5 9.7990036010742E-5 0.00033998489379883
Output for 5.4.43
6.103515625E-5 8.7976455688477E-5 0.00016403198242188
Output for 5.4.42
7.6055526733398E-5 6.9856643676758E-5 0.00014400482177734
Output for 5.4.41
7.2956085205078E-5 0.00017404556274414 0.00030708312988281
Output for 5.4.40
0.0001060962677002 6.413459777832E-5 0.00012898445129395
Output for 5.4.39
0.00014209747314453 0.00019502639770508 0.00041699409484863
Output for 5.4.38
8.8930130004883E-5 6.3896179199219E-5 0.0001528263092041
Output for 5.4.37
6.1988830566406E-5 8.5115432739258E-5 0.00020503997802734
Output for 5.4.36
6.103515625E-5 6.1988830566406E-5 0.00013399124145508
Output for 5.4.35
6.6995620727539E-5 6.1988830566406E-5 0.00017714500427246
Output for 5.4.34
6.103515625E-5 6.1988830566406E-5 0.00018191337585449
Output for 5.4.32
4.3869018554688E-5 6.2942504882812E-5 0.0001530647277832
Output for 5.4.31
7.1048736572266E-5 9.0122222900391E-5 0.00023412704467773
Output for 5.4.30
4.2915344238281E-5 7.6055526733398E-5 9.7990036010742E-5
Output for 5.4.29
4.4107437133789E-5 4.7922134399414E-5 0.00012421607971191
Output for 5.4.28
7.3909759521484E-5 7.5101852416992E-5 0.00019192695617676
Output for 5.4.27
8.0108642578125E-5 0.0001070499420166 0.00016617774963379
Output for 5.4.26
7.2956085205078E-5 7.9870223999023E-5 0.00021004676818848
Output for 5.4.25
7.4863433837891E-5 7.9870223999023E-5 0.00018405914306641
Output for 5.4.24
8.2969665527344E-5 7.8916549682617E-5 0.00017404556274414
Output for 5.4.23
7.7962875366211E-5 7.8916549682617E-5 0.00017094612121582
Output for 5.4.22
7.6055526733398E-5 7.4148178100586E-5 0.00024509429931641
Output for 5.4.21
8.8930130004883E-5 5.793571472168E-5 0.0001068115234375
Output for 5.4.20
7.8916549682617E-5 0.00010514259338379 0.00022602081298828
Output for 5.4.19
7.8201293945312E-5 0.00018501281738281 0.00017905235290527
Output for 5.4.18
7.6055526733398E-5 0.00012111663818359 0.00024890899658203
Output for 5.4.17
7.6055526733398E-5 7.7009201049805E-5 0.00020790100097656
Output for 5.4.16
7.2002410888672E-5 9.9897384643555E-5 0.00051498413085938
Output for 5.4.15
7.6055526733398E-5 7.6055526733398E-5 0.00040793418884277
Output for 5.4.14
7.2956085205078E-5 9.4890594482422E-5 0.00021100044250488
Output for 5.4.13
7.3909759521484E-5 0.00015902519226074 0.00028109550476074
Output for 5.4.12
7.5101852416992E-5 0.00010585784912109 0.00020503997802734
Output for 5.4.11
7.7009201049805E-5 7.1048736572266E-5 0.00016903877258301
Output for 5.4.10
7.4863433837891E-5 7.9154968261719E-5 0.00018405914306641
Output for 5.4.9
8.5115432739258E-5 0.0001060962677002 0.00018596649169922
Output for 5.4.8
7.0810317993164E-5 7.2002410888672E-5 0.00016999244689941
Output for 5.4.7
9.4175338745117E-5 0.00010108947753906 0.00017595291137695
Output for 5.4.6
7.6055526733398E-5 6.8902969360352E-5 0.00016307830810547
Output for 5.4.5
9.0122222900391E-5 7.9870223999023E-5 0.00016999244689941
Output for 5.4.4
0.00011491775512695 8.2015991210938E-5 0.0001671314239502
Output for 5.4.3
0.00011587142944336 9.8943710327148E-5 0.00024008750915527
Output for 5.4.2
7.0810317993164E-5 0.00011682510375977 0.0002739429473877
Output for 5.4.1
7.5101852416992E-5 8.2015991210938E-5 0.00017595291137695
Output for 5.4.0
0.0011467933654785 6.5803527832031E-5 0.00017595291137695
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/DOAHV 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/DOAHV on line 46
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/DOAHV on line 46
Process exited with code 255.