3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $total = 10000; $paragraph = 'this is a sentence. Crud! $$$$!'; $words = explode(' ', $paragraph); $badWordHash = [ '$$$$' => true, '@#$%' => true, 'crud' => true, 'fud' => true, 'fudd' => true, 'dud' => true ]; $s = microtime(true); for ($j = 0; $j < $total; $j++) { foreach ($words as $word) { isset($badWordHash[strtolower($word)]); } } echo "isset: ", (microtime(true) - $s), PHP_EOL; $s = microtime(true); for ($j = 0; $j < $total; $j++) { foreach ($words as $word) { array_key_exists(strtolower($word), $badWordHash); } } echo "array_key_exists: ", (microtime(true) - $s), PHP_EOL;
Output for 7.1.0
isset: 0.0044560432434082 array_key_exists: 0.0065569877624512
Output for 7.0.14
isset: 0.0060839653015137 array_key_exists: 0.0061039924621582
Output for 7.0.6
isset: 0.0041980743408203 array_key_exists: 0.0049679279327393
Output for 7.0.5
isset: 0.0049889087677002 array_key_exists: 0.005573034286499
Output for 7.0.4
isset: 0.0041449069976807 array_key_exists: 0.004741907119751
Output for 7.0.3
isset: 0.0043191909790039 array_key_exists: 0.0050411224365234
Output for 7.0.2
isset: 0.0031659603118896 array_key_exists: 0.0038769245147705
Output for 7.0.1
isset: 0.0043890476226807 array_key_exists: 0.0050508975982666
Output for 7.0.0
isset: 0.002938985824585 array_key_exists: 0.0034401416778564
Output for hhvm-3.12.0
isset: 0.0091938972473145 array_key_exists: 0.010769128799438
Output for hhvm-3.10.0
isset: 0.010530948638916 array_key_exists: 0.009321928024292
Output for 5.6.28
isset: 0.014436960220337 array_key_exists: 0.033478021621704
Output for 5.6.21
isset: 0.0081021785736084 array_key_exists: 0.012170076370239
Output for 5.6.20
isset: 0.011606931686401 array_key_exists: 0.01642894744873
Output for 5.6.19
isset: 0.0105299949646 array_key_exists: 0.015246868133545
Output for 5.6.18
isset: 0.0078620910644531 array_key_exists: 0.011793851852417
Output for 5.6.17
isset: 0.0092630386352539 array_key_exists: 0.012975931167603
Output for 5.6.16
isset: 0.011643171310425 array_key_exists: 0.016434907913208
Output for 5.6.15
isset: 0.0098810195922852 array_key_exists: 0.014225006103516
Output for 5.6.14
isset: 0.012711048126221 array_key_exists: 0.016853094100952
Output for 5.6.13
isset: 0.012480974197388 array_key_exists: 0.017925977706909
Output for 5.6.12
isset: 0.01137113571167 array_key_exists: 0.01714015007019
Output for 5.6.11
isset: 0.0080411434173584 array_key_exists: 0.012082815170288
Output for 5.6.10
isset: 0.012781858444214 array_key_exists: 0.016993045806885
Output for 5.6.9
isset: 0.007763147354126 array_key_exists: 0.011559963226318
Output for 5.6.8
isset: 0.0088989734649658 array_key_exists: 0.012710809707642
Output for 5.6.7
isset: 0.010613918304443 array_key_exists: 0.016657829284668
Output for 5.5.35
isset: 0.013621091842651 array_key_exists: 0.018944025039673
Output for 5.5.34
isset: 0.011753082275391 array_key_exists: 0.017126798629761
Output for 5.5.33
isset: 0.0092179775238037 array_key_exists: 0.013327836990356
Output for 5.5.32
isset: 0.012740850448608 array_key_exists: 0.017904996871948
Output for 5.5.31
isset: 0.011533975601196 array_key_exists: 0.016239166259766
Output for 5.5.30
isset: 0.012500047683716 array_key_exists: 0.017941951751709
Output for 5.5.29
isset: 0.013231039047241 array_key_exists: 0.018566131591797
Output for 5.5.28
isset: 0.010258913040161 array_key_exists: 0.014887094497681
Output for 5.5.27
isset: 0.013523101806641 array_key_exists: 0.019266843795776
Output for 5.5.26
isset: 0.013027191162109 array_key_exists: 0.017813205718994
Output for 5.5.25
isset: 0.010396003723145 array_key_exists: 0.015001058578491
Output for 5.5.24
isset: 0.013725996017456 array_key_exists: 0.019001007080078
Output for 5.4.45
isset: 0.0086090564727783 array_key_exists: 0.012409925460815
Output for 5.4.44
isset: 0.0086758136749268 array_key_exists: 0.012665987014771
Output for 5.4.43
isset: 0.0088808536529541 array_key_exists: 0.013127088546753
Output for 5.4.42
isset: 0.0084888935089111 array_key_exists: 0.01218581199646
Output for 5.4.41
isset: 0.0084500312805176 array_key_exists: 0.012497901916504
Output for 5.4.40
isset: 0.013246059417725 array_key_exists: 0.018271207809448
Output for 5.4.39
isset: 0.018038988113403 array_key_exists: 0.022671937942505
Output for 5.4.38
isset: 0.013250112533569 array_key_exists: 0.017467975616455
Output for 5.4.37
isset: 0.012902021408081 array_key_exists: 0.017584085464478
Output for 5.4.36
isset: 0.013901948928833 array_key_exists: 0.016058921813965
Output for 5.4.35
isset: 0.012363910675049 array_key_exists: 0.017263174057007
Output for 5.4.34
isset: 0.01157808303833 array_key_exists: 0.015916109085083
Output for 5.4.32
isset: 0.013168096542358 array_key_exists: 0.01798415184021
Output for 5.4.31
isset: 0.01202392578125 array_key_exists: 0.017391920089722
Output for 5.4.30
isset: 0.013543128967285 array_key_exists: 0.019083023071289
Output for 5.4.29
isset: 0.01387095451355 array_key_exists: 0.019751787185669
Output for 5.4.28
isset: 0.014656066894531 array_key_exists: 0.018848180770874
Output for 5.4.27
isset: 0.013921022415161 array_key_exists: 0.019081830978394
Output for 5.4.26
isset: 0.01195502281189 array_key_exists: 0.016873836517334
Output for 5.4.25
isset: 0.013323068618774 array_key_exists: 0.018421173095703
Output for 5.4.24
isset: 0.013580083847046 array_key_exists: 0.020117998123169
Output for 5.4.23
isset: 0.012955904006958 array_key_exists: 0.017596006393433
Output for 5.4.22
isset: 0.012561082839966 array_key_exists: 0.017287015914917
Output for 5.4.21
isset: 0.013808965682983 array_key_exists: 0.01898717880249
Output for 5.4.20
isset: 0.012306928634644 array_key_exists: 0.017248868942261
Output for 5.4.19
isset: 0.011919975280762 array_key_exists: 0.017618894577026
Output for 5.4.18
isset: 0.014275074005127 array_key_exists: 0.019165992736816
Output for 5.4.17
isset: 0.011953830718994 array_key_exists: 0.016860008239746
Output for 5.4.16
isset: 0.013930082321167 array_key_exists: 0.019021034240723
Output for 5.4.15
isset: 0.0084760189056396 array_key_exists: 0.012500047683716
Output for 5.4.14
isset: 0.01418399810791 array_key_exists: 0.01618218421936
Output for 5.4.13
isset: 0.010599136352539 array_key_exists: 0.014795780181885
Output for 5.4.12
isset: 0.0085208415985107 array_key_exists: 0.012669086456299
Output for 5.4.11
isset: 0.0084950923919678 array_key_exists: 0.012944936752319
Output for 5.4.10
isset: 0.0088920593261719 array_key_exists: 0.012797117233276
Output for 5.4.9
isset: 0.012453079223633 array_key_exists: 0.018328905105591
Output for 5.4.8
isset: 0.014696836471558 array_key_exists: 0.020112037658691
Output for 5.4.7
isset: 0.011673927307129 array_key_exists: 0.016524076461792
Output for 5.4.6
isset: 0.011812925338745 array_key_exists: 0.016407012939453
Output for 5.4.5
isset: 0.0084819793701172 array_key_exists: 0.012420892715454
Output for 5.4.4
isset: 0.011798143386841 array_key_exists: 0.016681909561157
Output for 5.4.3
isset: 0.014373064041138 array_key_exists: 0.018876075744629
Output for 5.4.2
isset: 0.013748168945312 array_key_exists: 0.018646001815796
Output for 5.4.1
isset: 0.012200117111206 array_key_exists: 0.016875982284546
Output for 5.4.0
isset: 0.01298713684082 array_key_exists: 0.017611980438232
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/cqTjX on line 7
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/cqTjX on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/cqTjX on line 7
Process exited with code 255.