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"; } }; $s1 = microtime(1); for ($i = 0; $i < 10000; $i++) { $f2($var); } echo microtime(1) - $s1; echo "\n"; $s = microtime(1); for ($i = 0; $i < 10000; $i++) { $f1($var); } echo microtime(1) - $s;
Output for 7.1.0
0.00070595741271973 0.00066304206848145
Output for 7.0.14
0.00069308280944824 0.00069689750671387
Output for 7.0.12
0.00063109397888184 0.00060701370239258
Output for 7.0.6
0.0006868839263916 0.00069785118103027
Output for 7.0.5
0.00066995620727539 0.00066900253295898
Output for 7.0.4
0.00060176849365234 0.00060415267944336
Output for 7.0.3
0.00054597854614258 0.00054502487182617
Output for 7.0.2
0.00046491622924805 0.0004420280456543
Output for 7.0.1
0.00063800811767578 0.00063800811767578
Output for 7.0.0
0.0006248950958252 0.00062417984008789
Output for hhvm-3.12.0
0.0016858577728271 0.0014770030975342
Output for hhvm-3.10.0
0.0016129016876221 0.0015969276428223
Output for 5.6.28
0.0018858909606934 0.0018889904022217
Output for 5.6.21
0.0016849040985107 0.0017211437225342
Output for 5.6.20
0.0016021728515625 0.0016510486602783
Output for 5.6.19
0.0014710426330566 0.0015769004821777
Output for 5.6.18
0.0010848045349121 0.0010979175567627
Output for 5.6.17
0.0012249946594238 0.0012109279632568
Output for 5.6.16
0.0015578269958496 0.0015780925750732
Output for 5.6.15
0.0014910697937012 0.0014989376068115
Output for 5.6.14
0.0010929107666016 0.001086950302124
Output for 5.6.13
0.001460075378418 0.0014760494232178
Output for 5.6.12
0.0014982223510742 0.0015029907226562
Output for 5.6.11
0.0013630390167236 0.001370906829834
Output for 5.6.10
0.0014669895172119 0.001478910446167
Output for 5.6.9
0.0012989044189453 0.001276969909668
Output for 5.6.8
0.0013999938964844 0.0014321804046631
Output for 5.6.7
0.0015799999237061 0.0016379356384277
Output for 5.6.6
0.0015459060668945 0.0014698505401611
Output for 5.6.5
0.0015368461608887 0.0015449523925781
Output for 5.6.4
0.0010180473327637 0.0010490417480469
Output for 5.6.3
0.0014750957489014 0.001488208770752
Output for 5.6.2
0.0015270709991455 0.0015380382537842
Output for 5.6.1
0.001471996307373 0.0014760494232178
Output for 5.6.0
0.0012650489807129 0.0012500286102295
Output for 5.5.35
0.0013489723205566 0.0022649765014648
Output for 5.5.34
0.0010509490966797 0.0010461807250977
Output for 5.5.33
0.0015201568603516 0.0015208721160889
Output for 5.5.32
0.0015511512756348 0.0015418529510498
Output for 5.5.31
0.0015177726745605 0.0012450218200684
Output for 5.5.30
0.0012578964233398 0.0012469291687012
Output for 5.5.29
0.0012280941009521 0.0012068748474121
Output for 5.5.28
0.0012998580932617 0.0013329982757568
Output for 5.5.27
0.0010170936584473 0.0010499954223633
Output for 5.5.26
0.0014040470123291 0.0014760494232178
Output for 5.5.25
0.0012130737304688 0.0011889934539795
Output for 5.5.24
0.0012547969818115 0.001209020614624
Output for 5.5.23
0.0015411376953125 0.0015528202056885
Output for 5.5.22
0.0010740756988525 0.0010659694671631
Output for 5.5.21
0.0013630390167236 0.0013811588287354
Output for 5.5.20
0.0010340213775635 0.0010221004486084
Output for 5.5.19
0.00136399269104 0.0014591217041016
Output for 5.5.18
0.0014979839324951 0.0014629364013672
Output for 5.5.16
0.0013391971588135 0.0013399124145508
Output for 5.5.15
0.0014739036560059 0.0015342235565186
Output for 5.5.14
0.0016248226165771 0.0015671253204346
Output for 5.5.13
0.0013878345489502 0.0015978813171387
Output for 5.5.12
0.0014300346374512 0.00142502784729
Output for 5.5.11
0.0014679431915283 0.0014059543609619
Output for 5.5.10
0.0010769367218018 0.0010569095611572
Output for 5.5.9
0.0015289783477783 0.0015630722045898
Output for 5.5.8
0.0010221004486084 0.0010311603546143
Output for 5.5.7
0.0012059211730957 0.0012168884277344
Output for 5.5.6
0.0010640621185303 0.0010139942169189
Output for 5.5.5
0.0032567977905273 0.0022621154785156
Output for 5.5.4
0.001450777053833 0.0014121532440186
Output for 5.5.3
0.0031681060791016 0.0031518936157227
Output for 5.5.2
0.0015637874603271 0.0015599727630615
Output for 5.5.1
0.001554012298584 0.0014448165893555
Output for 5.5.0
0.0010559558868408 0.0010740756988525
Output for 5.4.45
0.0013210773468018 0.0013089179992676
Output for 5.4.44
0.0014879703521729 0.0014581680297852
Output for 5.4.43
0.0013458728790283 0.0013470649719238
Output for 5.4.42
0.0014100074768066 0.0014290809631348
Output for 5.4.41
0.0014190673828125 0.0014321804046631
Output for 5.4.40
0.0013082027435303 0.0012948513031006
Output for 5.4.39
0.001082181930542 0.0011148452758789
Output for 5.4.38
0.0013108253479004 0.0012848377227783
Output for 5.4.37
0.00098705291748047 0.0010008811950684
Output for 5.4.36
0.00099492073059082 0.00095796585083008
Output for 5.4.35
0.0015649795532227 0.0014491081237793
Output for 5.4.34
0.0010049343109131 0.00099015235900879
Output for 5.4.32
0.0014660358428955 0.0012710094451904
Output for 5.4.31
0.0010519027709961 0.0010190010070801
Output for 5.4.30
0.0010509490966797 0.0010268688201904
Output for 5.4.29
0.0012140274047852 0.0011980533599854
Output for 5.4.28
0.0011751651763916 0.0011370182037354
Output for 5.4.27
0.0013940334320068 0.0012729167938232
Output for 5.4.26
0.0014438629150391 0.0013887882232666
Output for 5.4.25
0.0014491081237793 0.0014660358428955
Output for 5.4.24
0.00097107887268066 0.0009770393371582
Output for 5.4.23
0.00098800659179688 0.0010159015655518
Output for 5.4.22
0.0013988018035889 0.0012848377227783
Output for 5.4.21
0.0014169216156006 0.001439094543457
Output for 5.4.20
0.00148606300354 0.0015699863433838
Output for 5.4.19
0.0010499954223633 0.0010151863098145
Output for 5.4.18
0.0014781951904297 0.0011899471282959
Output for 5.4.17
0.0014121532440186 0.0014269351959229
Output for 5.4.16
0.0014739036560059 0.0014591217041016
Output for 5.4.15
0.0014917850494385 0.0016059875488281
Output for 5.4.14
0.001471996307373 0.0015151500701904
Output for 5.4.13
0.00099492073059082 0.0010149478912354
Output for 5.4.12
0.0012960433959961 0.0012791156768799
Output for 5.4.11
0.0011541843414307 0.0010559558868408
Output for 5.4.10
0.0010030269622803 0.0010161399841309
Output for 5.4.9
0.0010201930999756 0.0010590553283691
Output for 5.4.8
0.00099015235900879 0.0010519027709961
Output for 5.4.7
0.00094795227050781 0.00096511840820312
Output for 5.4.6
0.0012340545654297 0.0011701583862305
Output for 5.4.5
0.0015699863433838 0.0016398429870605
Output for 5.4.4
0.0011460781097412 0.0011429786682129
Output for 5.4.3
0.0016508102416992 0.0015819072723389
Output for 5.4.2
0.00097799301147461 0.00098109245300293
Output for 5.4.1
0.00097894668579102 0.0010240077972412
Output for 5.4.0
0.00097489356994629 0.0009770393371582
Output for 5.3.29
0.0015490055084229 0.0015759468078613
Output for 5.3.28
0.0011708736419678 0.0011670589447021
Output for 5.3.27
0.001755952835083 0.001884937286377
Output for 5.3.26
0.0016269683837891 0.0015850067138672
Output for 5.3.25
0.001676082611084 0.0017240047454834
Output for 5.3.24
0.0013501644134521 0.0013220310211182
Output for 5.3.23
0.0011188983917236 0.0011279582977295
Output for 5.3.22
0.0015299320220947 0.0015490055084229
Output for 5.3.21
0.0017979145050049 0.0019488334655762
Output for 5.3.20
0.001154899597168 0.0011501312255859
Output for 5.3.19
0.0015861988067627 0.0013711452484131
Output for 5.3.18
0.0011358261108398 0.0011260509490967
Output for 5.3.17
0.0011100769042969 0.0011169910430908
Output for 5.3.16
0.0010910034179688 0.0010809898376465
Output for 5.3.15
0.0013120174407959 0.0013010501861572
Output for 5.3.14
0.0011470317840576 0.0011420249938965
Output for 5.3.13
0.001183032989502 0.0011699199676514
Output for 5.3.12
0.0011780261993408 0.0011792182922363
Output for 5.3.11
0.0011801719665527 0.001166820526123
Output for 5.3.10
0.0011520385742188 0.0012331008911133
Output for 5.3.9
0.001133918762207 0.0011560916900635
Output for 5.3.8
0.0013630390167236 0.001147985458374
Output for 5.3.7
0.0017111301422119 0.0017180442810059
Output for 5.3.6
0.0012850761413574 0.001276969909668
Output for 5.3.5
0.0017931461334229 0.0018370151519775
Output for 5.3.4
0.0011539459228516 0.0011448860168457
Output for 5.3.3
0.0011570453643799 0.0011329650878906
Output for 5.3.2
0.0011510848999023 0.0011529922485352
Output for 5.3.1
0.0011289119720459 0.0011210441589355
Output for 5.3.0
0.0011560916900635 0.0011980533599854
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/m7Vtd 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/m7Vtd on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/m7Vtd on line 6
Process exited with code 255.