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) || $var) { //echo "set default"; } else { //echo "not default"; } }; $s = microtime(1); for ($i = 0; $i < 10000; $i++) { $f1($var); } echo microtime(1) - $s; echo "\n"; $s1 = microtime(1); for ($i = 0; $i < 10000; $i++) { $f2($var); } echo microtime(1) - $s1;
Output for 7.1.0
0.00051689147949219 0.00047516822814941
Output for 7.0.14
0.00079107284545898 0.00079202651977539
Output for 7.0.9
0.00042390823364258 0.00043392181396484
Output for 7.0.8
0.00049781799316406 0.00049209594726562
Output for 7.0.7
0.00044703483581543 0.00043392181396484
Output for 7.0.6
0.0004429817199707 0.00043916702270508
Output for 7.0.5
0.00036501884460449 0.00037717819213867
Output for 7.0.4
0.00055289268493652 0.00055384635925293
Output for 7.0.3
0.00070595741271973 0.00072598457336426
Output for 7.0.2
0.00067687034606934 0.00067806243896484
Output for 7.0.1
0.00067305564880371 0.00061893463134766
Output for 7.0.0
0.00071406364440918 0.00071215629577637
Output for hhvm-3.12.0
0.0016260147094727 0.0015618801116943
Output for hhvm-3.10.0
0.0022928714752197 0.0019428730010986
Output for 5.6.28
0.0019559860229492 0.0019800662994385
Output for 5.6.23
0.0014288425445557 0.0014898777008057
Output for 5.6.22
0.0010478496551514 0.0010490417480469
Output for 5.6.21
0.00095200538635254 0.00087594985961914
Output for 5.6.20
0.00089597702026367 0.00089502334594727
Output for 5.6.19
0.0011649131774902 0.0011818408966064
Output for 5.6.18
0.0014450550079346 0.0014569759368896
Output for 5.6.17
0.0015289783477783 0.0015871524810791
Output for 5.6.16
0.00164794921875 0.0016539096832275
Output for 5.6.15
0.0017399787902832 0.0018539428710938
Output for 5.6.14
0.0017209053039551 0.0016610622406006
Output for 5.6.13
0.0015189647674561 0.0015840530395508
Output for 5.6.12
0.001471996307373 0.0014770030975342
Output for 5.6.11
0.0013401508331299 0.0013320446014404
Output for 5.6.10
0.0017020702362061 0.0016908645629883
Output for 5.6.9
0.0015590190887451 0.0013790130615234
Output for 5.6.8
0.0016639232635498 0.0016410350799561
Output for 5.6.7
0.0012609958648682 0.0012750625610352
Output for 5.6.6
0.0018401145935059 0.002324104309082
Output for 5.6.5
0.0017449855804443 0.0016789436340332
Output for 5.6.4
0.0010409355163574 0.0010340213775635
Output for 5.6.3
0.0011348724365234 0.0011281967163086
Output for 5.6.2
0.001338005065918 0.0013191699981689
Output for 5.6.1
0.0010671615600586 0.001115083694458
Output for 5.6.0
0.0012757778167725 0.001288890838623
Output for 5.5.37
0.0010249614715576 0.0010120868682861
Output for 5.5.36
0.0013940334320068 0.0013020038604736
Output for 5.5.35
0.0010471343994141 0.0010809898376465
Output for 5.5.34
0.0012118816375732 0.0011839866638184
Output for 5.5.33
0.0017871856689453 0.00187087059021
Output for 5.5.32
0.0017538070678711 0.0017440319061279
Output for 5.5.31
0.001317024230957 0.0012111663818359
Output for 5.5.30
0.0013518333435059 0.0013670921325684
Output for 5.5.29
0.0015418529510498 0.0015311241149902
Output for 5.5.28
0.001054048538208 0.0010559558868408
Output for 5.5.27
0.0014281272888184 0.0014469623565674
Output for 5.5.26
0.0016558170318604 0.0016119480133057
Output for 5.5.25
0.0012679100036621 0.0012519359588623
Output for 5.5.24
0.0016379356384277 0.0015270709991455
Output for 5.5.23
0.0010941028594971 0.0010688304901123
Output for 5.5.22
0.0017571449279785 0.0016591548919678
Output for 5.5.21
0.0011911392211914 0.0011610984802246
Output for 5.5.20
0.0014748573303223 0.0015311241149902
Output for 5.5.19
0.0010278224945068 0.0010538101196289
Output for 5.5.18
0.0010149478912354 0.0010120868682861
Output for 5.5.16
0.0014059543609619 0.0014188289642334
Output for 5.5.15
0.0015528202056885 0.0015408992767334
Output for 5.5.14
0.0017068386077881 0.0014920234680176
Output for 5.5.13
0.0010249614715576 0.0010209083557129
Output for 5.5.12
0.001478910446167 0.0014069080352783
Output for 5.5.11
0.0010330677032471 0.0010230541229248
Output for 5.5.10
0.001021146774292 0.0010209083557129
Output for 5.5.9
0.0010380744934082 0.0010819435119629
Output for 5.5.8
0.0016460418701172 0.0016288757324219
Output for 5.5.7
0.0012438297271729 0.0012509822845459
Output for 5.5.6
0.0015909671783447 0.0016398429870605
Output for 5.5.5
0.0016388893127441 0.0018990039825439
Output for 5.5.4
0.0016980171203613 0.001708984375
Output for 5.5.3
0.0017459392547607 0.0017681121826172
Output for 5.5.2
0.0017490386962891 0.0019400119781494
Output for 5.5.1
0.0012540817260742 0.0012578964233398
Output for 5.5.0
0.0014371871948242 0.0011420249938965
Output for 5.4.45
0.0014581680297852 0.0014560222625732
Output for 5.4.44
0.0016469955444336 0.0016319751739502
Output for 5.4.43
0.0015599727630615 0.0015220642089844
Output for 5.4.42
0.0015451908111572 0.0015580654144287
Output for 5.4.41
0.0017759799957275 0.0024549961090088
Output for 5.4.40
0.0010449886322021 0.0010499954223633
Output for 5.4.39
0.0015869140625 0.0016119480133057
Output for 5.4.38
0.0016741752624512 0.0016310214996338
Output for 5.4.37
0.0017051696777344 0.0017299652099609
Output for 5.4.36
0.0014228820800781 0.0013940334320068
Output for 5.4.35
0.0010108947753906 0.00099015235900879
Output for 5.4.34
0.0011379718780518 0.00098705291748047
Output for 5.4.32
0.0012140274047852 0.0012321472167969
Output for 5.4.31
0.001384973526001 0.0013880729675293
Output for 5.4.30
0.00097918510437012 0.0010311603546143
Output for 5.4.29
0.00098395347595215 0.00097393989562988
Output for 5.4.28
0.0019600391387939 0.0017120838165283
Output for 5.4.27
0.0011639595031738 0.0011727809906006
Output for 5.4.26
0.0010740756988525 0.0011169910430908
Output for 5.4.25
0.00097799301147461 0.00097107887268066
Output for 5.4.24
0.0014629364013672 0.0014479160308838
Output for 5.4.23
0.0017378330230713 0.0017340183258057
Output for 5.4.22
0.0016839504241943 0.001690149307251
Output for 5.4.21
0.0011541843414307 0.0011610984802246
Output for 5.4.20
0.0018658638000488 0.001439094543457
Output for 5.4.19
0.0016429424285889 0.0016789436340332
Output for 5.4.18
0.0017080307006836 0.0020051002502441
Output for 5.4.17
0.0017118453979492 0.0016450881958008
Output for 5.4.16
0.00098395347595215 0.00099611282348633
Output for 5.4.15
0.0017309188842773 0.0017318725585938
Output for 5.4.14
0.0010049343109131 0.00098395347595215
Output for 5.4.13
0.0017249584197998 0.0017590522766113
Output for 5.4.12
0.0017619132995605 0.0017640590667725
Output for 5.4.11
0.0016860961914062 0.0017118453979492
Output for 5.4.10
0.0015950202941895 0.0015709400177002
Output for 5.4.9
0.001399040222168 0.001392126083374
Output for 5.4.8
0.0016210079193115 0.0015838146209717
Output for 5.4.7
0.001209020614624 0.0012340545654297
Output for 5.4.6
0.0017020702362061 0.0017030239105225
Output for 5.4.5
0.0017130374908447 0.0017149448394775
Output for 5.4.4
0.001784086227417 0.0017228126525879
Output for 5.4.3
0.0016958713531494 0.0017118453979492
Output for 5.4.2
0.0017251968383789 0.0016980171203613
Output for 5.4.1
0.0017058849334717 0.0016992092132568
Output for 5.4.0
0.0017030239105225 0.0017359256744385
Output for 5.3.29
0.0018188953399658 0.0018141269683838
Output for 5.3.28
0.0020010471343994 0.0017910003662109
Output for 5.3.27
0.0018599033355713 0.0019638538360596
Output for 5.3.26
0.0013489723205566 0.0013530254364014
Output for 5.3.25
0.0019409656524658 0.0018420219421387
Output for 5.3.24
0.0016839504241943 0.0016770362854004
Output for 5.3.23
0.0018310546875 0.0016019344329834
Output for 5.3.22
0.0017781257629395 0.0017471313476562
Output for 5.3.21
0.0020039081573486 0.0018961429595947
Output for 5.3.20
0.0020310878753662 0.0019259452819824
Output for 5.3.19
0.0018789768218994 0.0018961429595947
Output for 5.3.18
0.0016219615936279 0.0016419887542725
Output for 5.3.17
0.0012800693511963 0.0012140274047852
Output for 5.3.16
0.0019388198852539 0.001816987991333
Output for 5.3.15
0.0018582344055176 0.0017600059509277
Output for 5.3.14
0.0018990039825439 0.0020210742950439
Output for 5.3.13
0.0014488697052002 0.0014808177947998
Output for 5.3.12
0.0018019676208496 0.0019218921661377
Output for 5.3.11
0.0019009113311768 0.0018570423126221
Output for 5.3.10
0.001622200012207 0.0016510486602783
Output for 5.3.9
0.0013458728790283 0.0013778209686279
Output for 5.3.8
0.0016481876373291 0.0016670227050781
Output for 5.3.7
0.0012059211730957 0.001230001449585
Output for 5.3.6
0.0015261173248291 0.0014979839324951
Output for 5.3.5
0.0011458396911621 0.0012099742889404
Output for 5.3.4
0.0013329982757568 0.0012650489807129
Output for 5.3.3
0.001582145690918 0.0015788078308105
Output for 5.3.2
0.0020501613616943 0.0021750926971436
Output for 5.3.1
0.0020229816436768 0.0020301342010498
Output for 5.3.0
0.0012750625610352 0.0014829635620117
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/J2T1a 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/J2T1a on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/J2T1a on line 6
Process exited with code 255.