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) . "\n"; $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) . "\n";
Output for 7.1.0
isset: 0.0076501369476318 array_key_exists: 0.0099759101867676
Output for 7.0.14
isset: 0.0058460235595703 array_key_exists: 0.0061371326446533
Output for 7.0.10
isset: 0.0042459964752197 array_key_exists: 0.005134105682373
Output for 7.0.9
isset: 0.0040221214294434 array_key_exists: 0.0047128200531006
Output for 7.0.8
isset: 0.0077099800109863 array_key_exists: 0.0088510513305664
Output for 7.0.7
isset: 0.0035650730133057 array_key_exists: 0.0042440891265869
Output for 7.0.6
isset: 0.0041670799255371 array_key_exists: 0.0041649341583252
Output for 7.0.5
isset: 0.0033950805664062 array_key_exists: 0.0041971206665039
Output for 7.0.4
isset: 0.0044238567352295 array_key_exists: 0.0052769184112549
Output for 7.0.3
isset: 0.0044660568237305 array_key_exists: 0.0052359104156494
Output for 7.0.2
isset: 0.0047011375427246 array_key_exists: 0.0055050849914551
Output for 7.0.1
isset: 0.004500150680542 array_key_exists: 0.0046408176422119
Output for 7.0.0
isset: 0.0033059120178223 array_key_exists: 0.0046291351318359
Output for hhvm-3.12.0
isset: 0.013199090957642 array_key_exists: 0.01329517364502
Output for hhvm-3.10.0
isset: 0.014364957809448 array_key_exists: 0.014863967895508
Output for 5.6.28
isset: 0.014873027801514 array_key_exists: 0.022125959396362
Output for 5.6.25
isset: 0.013010025024414 array_key_exists: 0.017947196960449
Output for 5.6.24
isset: 0.012455940246582 array_key_exists: 0.017212867736816
Output for 5.6.23
isset: 0.013198137283325 array_key_exists: 0.017935991287231
Output for 5.6.22
isset: 0.014343976974487 array_key_exists: 0.018583059310913
Output for 5.6.21
isset: 0.011797904968262 array_key_exists: 0.015103101730347
Output for 5.6.20
isset: 0.012789964675903 array_key_exists: 0.018314123153687
Output for 5.6.19
isset: 0.010205984115601 array_key_exists: 0.015505790710449
Output for 5.6.18
isset: 0.012665033340454 array_key_exists: 0.018087148666382
Output for 5.6.17
isset: 0.011076927185059 array_key_exists: 0.015948057174683
Output for 5.6.16
isset: 0.0093998908996582 array_key_exists: 0.012371063232422
Output for 5.6.15
isset: 0.012228012084961 array_key_exists: 0.017299890518188
Output for 5.6.14
isset: 0.01265811920166 array_key_exists: 0.018189907073975
Output for 5.6.13
isset: 0.010807991027832 array_key_exists: 0.012986898422241
Output for 5.6.12
isset: 0.010403871536255 array_key_exists: 0.015691995620728
Output for 5.6.11
isset: 0.012856006622314 array_key_exists: 0.018250942230225
Output for 5.6.10
isset: 0.011887073516846 array_key_exists: 0.016842126846313
Output for 5.6.9
isset: 0.011854887008667 array_key_exists: 0.015079975128174
Output for 5.6.8
isset: 0.011880874633789 array_key_exists: 0.017141819000244
Output for 5.6.7
isset: 0.013056993484497 array_key_exists: 0.018532991409302
Output for 5.6.6
isset: 0.012776136398315 array_key_exists: 0.014734983444214
Output for 5.6.5
isset: 0.011240005493164 array_key_exists: 0.013013124465942
Output for 5.6.4
isset: 0.013015985488892 array_key_exists: 0.016152143478394
Output for 5.6.3
isset: 0.012769937515259 array_key_exists: 0.017135143280029
Output for 5.6.2
isset: 0.011569976806641 array_key_exists: 0.016448974609375
Output for 5.6.1
isset: 0.011576890945435 array_key_exists: 0.015846967697144
Output for 5.6.0
isset: 0.013217926025391 array_key_exists: 0.017863988876343
Output for 5.5.38
isset: 0.011497974395752 array_key_exists: 0.016999959945679
Output for 5.5.37
isset: 0.013676166534424 array_key_exists: 0.019284963607788
Output for 5.5.36
isset: 0.013799905776978 array_key_exists: 0.019567966461182
Output for 5.5.35
isset: 0.012701988220215 array_key_exists: 0.015583038330078
Output for 5.5.34
isset: 0.012237071990967 array_key_exists: 0.017668008804321
Output for 5.5.33
isset: 0.012866020202637 array_key_exists: 0.015258073806763
Output for 5.5.32
isset: 0.012328863143921 array_key_exists: 0.014961957931519
Output for 5.5.31
isset: 0.010210037231445 array_key_exists: 0.014930009841919
Output for 5.5.30
isset: 0.014092206954956 array_key_exists: 0.019922018051147
Output for 5.5.29
isset: 0.013841152191162 array_key_exists: 0.019780158996582
Output for 5.5.28
isset: 0.011221170425415 array_key_exists: 0.01514196395874
Output for 5.5.27
isset: 0.010390996932983 array_key_exists: 0.017014980316162
Output for 5.5.26
isset: 0.011423110961914 array_key_exists: 0.016685009002686
Output for 5.5.25
isset: 0.010136127471924 array_key_exists: 0.014277935028076
Output for 5.5.24
isset: 0.012299060821533 array_key_exists: 0.017530918121338
Output for 5.5.23
isset: 0.012243032455444 array_key_exists: 0.016702175140381
Output for 5.5.22
isset: 0.012131929397583 array_key_exists: 0.017056941986084
Output for 5.5.21
isset: 0.01115894317627 array_key_exists: 0.015278816223145
Output for 5.5.20
isset: 0.014189958572388 array_key_exists: 0.019798994064331
Output for 5.5.19
isset: 0.013509035110474 array_key_exists: 0.019527912139893
Output for 5.5.18
isset: 0.01230001449585 array_key_exists: 0.018032073974609
Output for 5.5.16
isset: 0.014022827148438 array_key_exists: 0.019838094711304
Output for 5.5.15
isset: 0.011733055114746 array_key_exists: 0.015512943267822
Output for 5.5.14
isset: 0.013235092163086 array_key_exists: 0.017155885696411
Output for 5.5.13
isset: 0.015125036239624 array_key_exists: 0.02065110206604
Output for 5.5.12
isset: 0.012137889862061 array_key_exists: 0.015298128128052
Output for 5.5.11
isset: 0.011961936950684 array_key_exists: 0.017116069793701
Output for 5.5.10
isset: 0.01166296005249 array_key_exists: 0.014542102813721
Output for 5.5.9
isset: 0.012978076934814 array_key_exists: 0.018700122833252
Output for 5.5.8
isset: 0.012687921524048 array_key_exists: 0.015401124954224
Output for 5.5.7
isset: 0.012386083602905 array_key_exists: 0.018210172653198
Output for 5.5.6
isset: 0.011497974395752 array_key_exists: 0.017544031143188
Output for 5.5.5
isset: 0.013753890991211 array_key_exists: 0.017131090164185
Output for 5.5.4
isset: 0.014741897583008 array_key_exists: 0.015394926071167
Output for 5.5.3
isset: 0.010890007019043 array_key_exists: 0.016283988952637
Output for 5.5.2
isset: 0.0084428787231445 array_key_exists: 0.012880086898804
Output for 5.5.1
isset: 0.012478828430176 array_key_exists: 0.017032861709595
Output for 5.5.0
isset: 0.0095710754394531 array_key_exists: 0.016144990921021
Output for 5.4.45
isset: 0.012203931808472 array_key_exists: 0.016777038574219
Output for 5.4.44
isset: 0.013908863067627 array_key_exists: 0.019062042236328
Output for 5.4.43
isset: 0.013812065124512 array_key_exists: 0.019439935684204
Output for 5.4.42
isset: 0.01195502281189 array_key_exists: 0.01557183265686
Output for 5.4.41
isset: 0.012321949005127 array_key_exists: 0.015067100524902
Output for 5.4.40
isset: 0.013025045394897 array_key_exists: 0.018501043319702
Output for 5.4.39
isset: 0.013365983963013 array_key_exists: 0.017902851104736
Output for 5.4.38
isset: 0.012103080749512 array_key_exists: 0.015269994735718
Output for 5.4.37
isset: 0.013956069946289 array_key_exists: 0.016313076019287
Output for 5.4.36
isset: 0.013750076293945 array_key_exists: 0.019216060638428
Output for 5.4.35
isset: 0.012315034866333 array_key_exists: 0.023324012756348
Output for 5.4.34
isset: 0.013108015060425 array_key_exists: 0.017050981521606
Output for 5.4.32
isset: 0.012722969055176 array_key_exists: 0.016098022460938
Output for 5.4.31
isset: 0.01200795173645 array_key_exists: 0.016391038894653
Output for 5.4.30
isset: 0.013252019882202 array_key_exists: 0.018726825714111
Output for 5.4.29
isset: 0.014535903930664 array_key_exists: 0.020210027694702
Output for 5.4.28
isset: 0.01304292678833 array_key_exists: 0.015015840530396
Output for 5.4.27
isset: 0.015111207962036 array_key_exists: 0.019757986068726
Output for 5.4.26
isset: 0.014362812042236 array_key_exists: 0.01967191696167
Output for 5.4.25
isset: 0.012433052062988 array_key_exists: 0.015429019927979
Output for 5.4.24
isset: 0.011038064956665 array_key_exists: 0.014081954956055
Output for 5.4.23
isset: 0.012097120285034 array_key_exists: 0.016857862472534
Output for 5.4.22
isset: 0.014554977416992 array_key_exists: 0.019891023635864
Output for 5.4.21
isset: 0.013743162155151 array_key_exists: 0.018347024917603
Output for 5.4.20
isset: 0.009268045425415 array_key_exists: 0.013251066207886
Output for 5.4.19
isset: 0.01078200340271 array_key_exists: 0.015586853027344
Output for 5.4.18
isset: 0.013084888458252 array_key_exists: 0.019029855728149
Output for 5.4.17
isset: 0.0083110332489014 array_key_exists: 0.012676000595093
Output for 5.4.16
isset: 0.0084359645843506 array_key_exists: 0.012490034103394
Output for 5.4.15
isset: 0.0095911026000977 array_key_exists: 0.013536930084229
Output for 5.4.14
isset: 0.01648211479187 array_key_exists: 0.017815828323364
Output for 5.4.13
isset: 0.0085110664367676 array_key_exists: 0.012495040893555
Output for 5.4.12
isset: 0.0085709095001221 array_key_exists: 0.012711048126221
Output for 5.4.11
isset: 0.0093038082122803 array_key_exists: 0.01382303237915
Output for 5.4.10
isset: 0.0075700283050537 array_key_exists: 0.010903835296631
Output for 5.4.9
isset: 0.011208057403564 array_key_exists: 0.015996932983398
Output for 5.4.8
isset: 0.00901198387146 array_key_exists: 0.013098001480103
Output for 5.4.7
isset: 0.0085659027099609 array_key_exists: 0.012042999267578
Output for 5.4.6
isset: 0.0092480182647705 array_key_exists: 0.014000177383423
Output for 5.4.5
isset: 0.0085229873657227 array_key_exists: 0.012415885925293
Output for 5.4.4
isset: 0.0102379322052 array_key_exists: 0.013862133026123
Output for 5.4.3
isset: 0.013077974319458 array_key_exists: 0.018522977828979
Output for 5.4.2
isset: 0.012658834457397 array_key_exists: 0.017698049545288
Output for 5.4.1
isset: 0.011468172073364 array_key_exists: 0.016057968139648
Output for 5.4.0
isset: 0.01305103302002 array_key_exists: 0.018543004989624
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/vfRfB on line 8
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/vfRfB on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/vfRfB on line 8
Process exited with code 255.