3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //$var = 'A'; //$var = ''; //$var = null; $var = 0; $f1 = function($var) { if (! isset($var) || $var) { //echo "set default"; //"not empty or not defiend or a null value"; } else { //echo "not default"; //"empty"; } }; $f2 = function($var) { if (! isset($var) || ! empty($var)) { //echo "set default"; } else { //echo "not default"; } }; $s = microtime(1); for ($i = 0; $i < 10000; $i++) { $f1($var); } echo microtime(1) - $s;
Output for 7.1.0
0.0007939338684082
Output for 7.0.14
0.00079011917114258
Output for 7.0.10
0.00061488151550293
Output for 7.0.9
0.00058197975158691
Output for 7.0.8
0.00058603286743164
Output for 7.0.7
0.00050687789916992
Output for 7.0.6
0.00069403648376465
Output for 7.0.5
0.00066614151000977
Output for 7.0.4
0.00063490867614746
Output for 7.0.3
0.00049114227294922
Output for 7.0.2
0.00066304206848145
Output for 7.0.1
0.00067591667175293
Output for 7.0.0
0.00053906440734863
Output for 5.6.28
0.0019559860229492
Output for 5.6.25
0.001270055770874
Output for 5.5.16, 5.6.24
0.0015048980712891
Output for 5.3.20, 5.4.13, 5.6.7, 5.6.23
0.0015900135040283
Output for 5.6.22
0.0010790824890137
Output for 5.6.21
0.0011701583862305
Output for 5.6.20
0.0024769306182861
Output for 5.6.19
0.00146484375
Output for 5.6.18
0.001107931137085
Output for 5.6.17
0.0012969970703125
Output for 5.6.16
0.0013549327850342
Output for 5.6.15
0.0012168884277344
Output for 5.3.12, 5.6.14
0.0015981197357178
Output for 5.6.13
0.0016269683837891
Output for 5.6.12
0.0015060901641846
Output for 5.5.19, 5.6.11
0.0016629695892334
Output for 5.6.10
0.0013840198516846
Output for 5.6.9
0.0015749931335449
Output for 5.6.8
0.0013260841369629
Output for 5.4.6, 5.6.6
0.0017070770263672
Output for 5.6.5
0.0017020702362061
Output for 5.6.4
0.001812219619751
Output for 5.6.3
0.0011641979217529
Output for 5.6.2
0.0015430450439453
Output for 5.6.1
0.0015361309051514
Output for 5.6.0
0.0018768310546875
Output for 5.4.5, 5.5.38
0.0016169548034668
Output for 5.5.37
0.0017168521881104
Output for 5.5.36
0.0014231204986572
Output for 5.5.35
0.0012578964233398
Output for 5.5.34
0.0013248920440674
Output for 5.5.23, 5.5.33
0.0012209415435791
Output for 5.5.32
0.001166820526123
Output for 5.5.31
0.0012178421020508
Output for 5.5.30
0.001054048538208
Output for 5.3.27, 5.5.29
0.001147985458374
Output for 5.5.28
0.0013699531555176
Output for 5.5.27
0.0017459392547607
Output for 5.5.26
0.0017011165618896
Output for 5.5.25
0.0018699169158936
Output for 5.5.24
0.0010530948638916
Output for 5.5.22
0.0013270378112793
Output for 5.5.21
0.0013570785522461
Output for 5.5.20
0.0015602111816406
Output for 5.5.18
0.0021491050720215
Output for 5.5.15
0.0012359619140625
Output for 5.5.14
0.0018949508666992
Output for 5.5.13
0.0014870166778564
Output for 5.5.12
0.0013830661773682
Output for 5.5.11
0.0012750625610352
Output for 5.5.10
0.0016698837280273
Output for 5.5.9
0.0015618801116943
Output for 5.5.8
0.0010039806365967
Output for 5.5.7
0.0014939308166504
Output for 5.5.6
0.0016829967498779
Output for 5.5.5
0.0014212131500244
Output for 5.5.4
0.0017561912536621
Output for 5.5.3
0.0011520385742188
Output for 5.5.2
0.0014801025390625
Output for 5.5.1
0.0012388229370117
Output for 5.5.0
0.0017127990722656
Output for 5.4.45
0.0010380744934082
Output for 5.4.44
0.0011639595031738
Output for 5.4.43
0.0012309551239014
Output for 5.4.42
0.0012340545654297
Output for 5.4.41
0.0012428760528564
Output for 5.4.40
0.0012249946594238
Output for 5.4.39
0.00096917152404785
Output for 5.4.38
0.0012850761413574
Output for 5.4.37
0.0013320446014404
Output for 5.4.36
0.0013139247894287
Output for 5.4.35
0.0012869834899902
Output for 5.4.34
0.0017039775848389
Output for 5.4.32
0.0014810562133789
Output for 5.4.31
0.0018069744110107
Output for 5.4.30
0.0013217926025391
Output for 5.4.29
0.0010249614715576
Output for 5.4.28
0.00098299980163574
Output for 5.4.27
0.0016448497772217
Output for 5.4.26
0.001384973526001
Output for 5.4.25
0.0013659000396729
Output for 5.4.24
0.0014400482177734
Output for 5.4.23
0.0014488697052002
Output for 5.4.22
0.0015308856964111
Output for 5.4.21
0.0014188289642334
Output for 5.4.20
0.001331090927124
Output for 5.4.19
0.0011961460113525
Output for 5.4.18
0.0013861656188965
Output for 5.4.17
0.0013010501861572
Output for 5.4.16
0.0015242099761963
Output for 5.4.15
0.00099611282348633
Output for 5.4.14
0.0012598037719727
Output for 5.4.12
0.0011329650878906
Output for 5.4.11
0.0015380382537842
Output for 5.4.10
0.0010709762573242
Output for 5.4.9
0.0011270046234131
Output for 5.4.8
0.0014040470123291
Output for 5.4.7
0.00098395347595215
Output for 5.4.4
0.0018088817596436
Output for 5.4.3
0.0016579627990723
Output for 5.4.2
0.0016560554504395
Output for 5.4.1
0.0014710426330566
Output for 5.4.0
0.0012481212615967
Output for 5.3.29
0.0015311241149902
Output for 5.3.28
0.0011191368103027
Output for 5.3.26
0.0012049674987793
Output for 5.3.25
0.0018730163574219
Output for 5.3.24
0.0017881393432617
Output for 5.3.23
0.0019769668579102
Output for 5.3.22
0.001953125
Output for 5.3.21
0.0019991397857666
Output for 5.3.19
0.0015769004821777
Output for 5.3.18
0.0020201206207275
Output for 5.3.17
0.0016210079193115
Output for 5.3.16
0.001554012298584
Output for 5.3.15
0.0018758773803711
Output for 5.3.14
0.0012369155883789
Output for 5.3.13
0.0024230480194092
Output for 5.3.11
0.0016050338745117
Output for 5.3.10
0.0020091533660889
Output for 5.3.9
0.0019199848175049
Output for 5.3.8
0.0018649101257324
Output for 5.3.7
0.0018150806427002
Output for 5.3.6
0.0014629364013672
Output for 5.3.5
0.0017900466918945
Output for 5.3.4
0.0016939640045166
Output for 5.3.3
0.0012071132659912
Output for 5.3.2
0.0012450218200684
Output for 5.3.1
0.0011489391326904
Output for 5.3.0
0.0016639232635498
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/62WZQ on line 6
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 T_FUNCTION in /in/62WZQ on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/62WZQ on line 6
Process exited with code 255.