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; echo "\n"; $s1 = microtime(1); for ($i = 0; $i < 10000; $i++) { $f2($var); } echo microtime(1) - $s1;
Output for 7.1.0
0.0006401538848877 0.00087499618530273
Output for 7.0.14
0.00075483322143555 0.001115083694458
Output for 7.0.10
0.00052118301391602 0.00051403045654297
Output for 7.0.9
0.00059914588928223 0.00053191184997559
Output for 7.0.8
0.00045609474182129 0.00047397613525391
Output for 7.0.7
0.00044107437133789 0.00049686431884766
Output for 7.0.6
0.00044608116149902 0.00062417984008789
Output for 7.0.5
0.00050187110900879 0.00060296058654785
Output for 7.0.4
0.00044393539428711 0.00049495697021484
Output for 7.0.3
0.00042486190795898 0.00047183036804199
Output for 7.0.2
0.00049614906311035 0.00056719779968262
Output for 7.0.1
0.00069499015808105 0.00078296661376953
Output for 7.0.0
0.0005650520324707 0.0006251335144043
Output for hhvm-3.12.0
0.0018198490142822 0.0017969608306885
Output for hhvm-3.10.0
0.0034019947052002 0.0032260417938232
Output for 5.6.28
0.0019340515136719 0.0025160312652588
Output for 5.6.25
0.0010480880737305 0.0011398792266846
Output for 5.6.24
0.0011670589447021 0.001270055770874
Output for 5.6.23
0.0015938282012939 0.0017220973968506
Output for 5.6.22
0.0012218952178955 0.0013189315795898
Output for 5.6.21
0.0010840892791748 0.0012118816375732
Output for 5.6.20
0.0010099411010742 0.0011160373687744
Output for 5.6.19
0.0011181831359863 0.0011940002441406
Output for 5.6.18
0.0012350082397461 0.0012071132659912
Output for 5.6.17
0.0010240077972412 0.0011570453643799
Output for 5.6.16
0.0017108917236328 0.0018758773803711
Output for 5.6.15
0.0010747909545898 0.00098896026611328
Output for 5.6.14
0.0012569427490234 0.0013358592987061
Output for 5.6.13
0.001680850982666 0.0019409656524658
Output for 5.6.12
0.0018808841705322 0.0019881725311279
Output for 5.6.11
0.0016560554504395 0.0018410682678223
Output for 5.6.10
0.001460075378418 0.0016660690307617
Output for 5.6.9
0.0011048316955566 0.0012071132659912
Output for 5.6.8
0.0017769336700439 0.0018119812011719
Output for 5.6.7
0.0017158985137939 0.0020251274108887
Output for 5.6.6
0.0018072128295898 0.0018808841705322
Output for 5.6.5
0.0015769004821777 0.0017459392547607
Output for 5.6.4
0.0016441345214844 0.0018341541290283
Output for 5.6.3
0.0018348693847656 0.0020439624786377
Output for 5.6.2
0.0014691352844238 0.001655101776123
Output for 5.6.1
0.0015599727630615 0.0017011165618896
Output for 5.6.0
0.0015771389007568 0.0017240047454834
Output for 5.5.38
0.0010981559753418 0.0012648105621338
Output for 5.5.37
0.001054048538208 0.0011188983917236
Output for 5.5.36
0.001317024230957 0.0014209747314453
Output for 5.5.35
0.0014197826385498 0.0012578964233398
Output for 5.5.34
0.0010528564453125 0.0011601448059082
Output for 5.5.33
0.00154709815979 0.0016801357269287
Output for 5.5.32
0.0010437965393066 0.0011661052703857
Output for 5.5.31
0.0010180473327637 0.0011320114135742
Output for 5.5.30
0.0012199878692627 0.001237154006958
Output for 5.5.29
0.0013530254364014 0.0013918876647949
Output for 5.5.28
0.0016570091247559 0.0018410682678223
Output for 5.5.27
0.0016508102416992 0.0018301010131836
Output for 5.5.26
0.00148606300354 0.0016710758209229
Output for 5.5.25
0.0014538764953613 0.0015370845794678
Output for 5.5.24
0.0016860961914062 0.0018739700317383
Output for 5.5.23
0.0016989707946777 0.002094030380249
Output for 5.5.22
0.0015110969543457 0.0017211437225342
Output for 5.5.21
0.0016939640045166 0.0018670558929443
Output for 5.5.20
0.0016260147094727 0.0017011165618896
Output for 5.5.19
0.0014300346374512 0.0015480518341064
Output for 5.5.18
0.0012929439544678 0.0014410018920898
Output for 5.5.16
0.001446008682251 0.0014240741729736
Output for 5.5.15
0.001244068145752 0.0013718605041504
Output for 5.5.14
0.0010080337524414 0.0010521411895752
Output for 5.5.13
0.0017008781433105 0.0018599033355713
Output for 5.5.12
0.0016708374023438 0.0018792152404785
Output for 5.5.11
0.0010180473327637 0.0011148452758789
Output for 5.5.10
0.0016741752624512 0.002047061920166
Output for 5.5.9
0.0014488697052002 0.001849889755249
Output for 5.5.8
0.0014989376068115 0.0016331672668457
Output for 5.5.7
0.0010230541229248 0.0011570453643799
Output for 5.5.6
0.0016560554504395 0.001533031463623
Output for 5.5.5
0.0016920566558838 0.0018229484558105
Output for 5.5.4
0.0017271041870117 0.0019190311431885
Output for 5.5.3
0.0020749568939209 0.0013749599456787
Output for 5.5.2
0.0016050338745117 0.0017640590667725
Output for 5.5.1
0.0018649101257324 0.0018229484558105
Output for 5.5.0
0.0012719631195068 0.0013480186462402
Output for 5.4.45
0.0012049674987793 0.0013248920440674
Output for 5.4.44
0.0014710426330566 0.0012309551239014
Output for 5.4.43
0.0015730857849121 0.0016260147094727
Output for 5.4.42
0.0016219615936279 0.0017349720001221
Output for 5.4.41
0.0011000633239746 0.0011839866638184
Output for 5.4.40
0.0011849403381348 0.0012969970703125
Output for 5.4.39
0.0016319751739502 0.001788854598999
Output for 5.4.38
0.0013668537139893 0.0015099048614502
Output for 5.4.37
0.0010077953338623 0.0011060237884521
Output for 5.4.36
0.0013160705566406 0.0014421939849854
Output for 5.4.35
0.0014059543609619 0.0015599727630615
Output for 5.4.34
0.0015652179718018 0.0017099380493164
Output for 5.4.32
0.0011930465698242 0.001338005065918
Output for 5.4.31
0.001478910446167 0.0017580986022949
Output for 5.4.30
0.0014958381652832 0.001762866973877
Output for 5.4.29
0.0016679763793945 0.0018520355224609
Output for 5.4.28
0.0012319087982178 0.0015978813171387
Output for 5.4.27
0.0012929439544678 0.0014181137084961
Output for 5.4.26
0.0017039775848389 0.0017950534820557
Output for 5.4.25
0.0015208721160889 0.0017790794372559
Output for 5.4.24
0.001101016998291 0.0012130737304688
Output for 5.4.23
0.0017180442810059 0.0018839836120605
Output for 5.4.22
0.0015161037445068 0.0017118453979492
Output for 5.4.21
0.0013508796691895 0.0014910697937012
Output for 5.4.20
0.00164794921875 0.0018110275268555
Output for 5.4.19
0.0015828609466553 0.0017509460449219
Output for 5.4.18
0.0015699863433838 0.0016021728515625
Output for 5.4.17
0.0016078948974609 0.0018141269683838
Output for 5.4.16
0.0017340183258057 0.0027399063110352
Output for 5.4.15
0.0013320446014404 0.0012760162353516
Output for 5.4.14
0.0016241073608398 0.0017709732055664
Output for 5.4.13
0.0016078948974609 0.0018570423126221
Output for 5.4.12
0.0013768672943115 0.0019030570983887
Output for 5.4.11
0.0013480186462402 0.0014848709106445
Output for 5.4.10
0.0015618801116943 0.0016450881958008
Output for 5.4.9
0.0015509128570557 0.0016112327575684
Output for 5.4.8
0.0017879009246826 0.0017220973968506
Output for 5.4.7
0.0016419887542725 0.0018010139465332
Output for 5.4.6
0.0013201236724854 0.0015308856964111
Output for 5.4.5
0.0016908645629883 0.0018100738525391
Output for 5.4.4
0.0016829967498779 0.0018110275268555
Output for 5.4.3
0.0013470649719238 0.0014920234680176
Output for 5.4.2
0.0014781951904297 0.0013618469238281
Output for 5.4.1
0.0016520023345947 0.0018301010131836
Output for 5.4.0
0.0014491081237793 0.0016369819641113
Output for 5.3.29
0.0014278888702393 0.0015609264373779
Output for 5.3.28
0.0014970302581787 0.0015640258789062
Output for 5.3.27
0.0018439292907715 0.0020449161529541
Output for 5.3.26
0.0015661716461182 0.0017731189727783
Output for 5.3.25
0.002032995223999 0.002249002456665
Output for 5.3.24
0.0018811225891113 0.0021021366119385
Output for 5.3.23
0.0013659000396729 0.001594066619873
Output for 5.3.22
0.0018701553344727 0.0020358562469482
Output for 5.3.21
0.0018830299377441 0.0016930103302002
Output for 5.3.20
0.0018270015716553 0.0019509792327881
Output for 5.3.19
0.0011699199676514 0.0014851093292236
Output for 5.3.18
0.0014338493347168 0.0018978118896484
Output for 5.3.17
0.0017120838165283 0.001957893371582
Output for 5.3.16
0.0017597675323486 0.0019600391387939
Output for 5.3.15
0.0018689632415771 0.0022211074829102
Output for 5.3.14
0.0020179748535156 0.0022451877593994
Output for 5.3.13
0.0018930435180664 0.0020949840545654
Output for 5.3.12
0.0017220973968506 0.0019021034240723
Output for 5.3.11
0.0018079280853271 0.0020182132720947
Output for 5.3.10
0.0024609565734863 0.0026249885559082
Output for 5.3.9
0.0017759799957275 0.002004861831665
Output for 5.3.8
0.0016281604766846 0.0018370151519775
Output for 5.3.7
0.0011799335479736 0.0013117790222168
Output for 5.3.6
0.0013399124145508 0.0014879703521729
Output for 5.3.5
0.0011441707611084 0.0012540817260742
Output for 5.3.4
0.0012190341949463 0.0013551712036133
Output for 5.3.3
0.0016520023345947 0.0017368793487549
Output for 5.3.2
0.0017819404602051 0.0019690990447998
Output for 5.3.1
0.0020771026611328 0.0022909641265869
Output for 5.3.0
0.0015261173248291 0.0016689300537109
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/bqHhQ 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/bqHhQ on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/bqHhQ on line 6
Process exited with code 255.