3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(0); $start = microtime(true); for($i = 0; $i < 1000; $i++) { $alreadyOutput = array(); foreach ($results as $result) { if(in_array($result->date, $alreadyOutput)){ continue; } $alreadyOutput[] = $result->date; echo $result->date . "<br />"; } } echo "in_array: ".(microtime(true) - $start)."ms || "; $start2 = microtime(true); for($i = 0; $i < 1000; $i++) { $echoedArray = array(); foreach ($results as $result) { if ($echoedArray[$result->date]) { continue; } echo $result->date . "<br />"; $echoedArray[$result->date] = true; } } echo "by key: ".(microtime(true) - $start2)."ms";
based on beMDX
Output for 7.1.0
in_array: 0.0010330677032471ms || by key: 0.0010349750518799ms
Output for 7.0.14
in_array: 0.00073599815368652ms || by key: 0.00073409080505371ms
Output for 7.0.10
in_array: 0.0004730224609375ms || by key: 0.00047802925109863ms
Output for 7.0.9
in_array: 0.00058794021606445ms || by key: 0.00058913230895996ms
Output for 7.0.8
in_array: 0.00048398971557617ms || by key: 0.00045514106750488ms
Output for 7.0.7
in_array: 0.00063991546630859ms || by key: 0.00064492225646973ms
Output for 7.0.6
in_array: 0.00045299530029297ms || by key: 0.00045013427734375ms
Output for 7.0.5
in_array: 0.00044798851013184ms || by key: 0.0004429817199707ms
Output for 7.0.4
in_array: 0.00034999847412109ms || by key: 0.00036406517028809ms
Output for 7.0.3
in_array: 0.00043010711669922ms || by key: 0.00044989585876465ms
Output for 7.0.2
in_array: 0.00053000450134277ms || by key: 0.00053191184997559ms
Output for 7.0.1
in_array: 0.00046396255493164ms || by key: 0.00046086311340332ms
Output for 7.0.0
in_array: 0.00046801567077637ms || by key: 0.00048208236694336ms
Output for 5.6.28
in_array: 0.00074100494384766ms || by key: 0.00080084800720215ms
Output for 5.6.25
in_array: 0.00059604644775391ms || by key: 0.00059199333190918ms
Output for 5.6.24
in_array: 0.00058317184448242ms || by key: 0.0005490779876709ms
Output for 5.6.23
in_array: 0.00054407119750977ms || by key: 0.00052809715270996ms
Output for 5.6.22
in_array: 0.00067996978759766ms || by key: 0.00061607360839844ms
Output for 5.6.21
in_array: 0.00064802169799805ms || by key: 0.00062799453735352ms
Output for 5.6.20
in_array: 0.00057005882263184ms || by key: 0.00054693222045898ms
Output for 5.6.19
in_array: 0.00039100646972656ms || by key: 0.00037789344787598ms
Output for 5.6.18
in_array: 0.00046205520629883ms || by key: 0.00044393539428711ms
Output for 5.6.17
in_array: 0.00059795379638672ms || by key: 0.00060892105102539ms
Output for 5.6.16
in_array: 0.00060391426086426ms || by key: 0.00055909156799316ms
Output for 5.6.15
in_array: 0.00044107437133789ms || by key: 0.00042891502380371ms
Output for 5.6.14
in_array: 0.00050520896911621ms || by key: 0.00048995018005371ms
Output for 5.6.13
in_array: 0.000518798828125ms || by key: 0.00053501129150391ms
Output for 5.6.12
in_array: 0.0005497932434082ms || by key: 0.00053906440734863ms
Output for 5.6.11
in_array: 0.00044798851013184ms || by key: 0.00046300888061523ms
Output for 5.6.10
in_array: 0.00061297416687012ms || by key: 0.00061488151550293ms
Output for 5.6.9
in_array: 0.00045394897460938ms || by key: 0.00046396255493164ms
Output for 5.6.8
in_array: 0.00068807601928711ms || by key: 0.00063395500183105ms
Output for 5.6.7
in_array: 0.00053715705871582ms || by key: 0.0005490779876709ms
Output for 5.6.6
in_array: 0.00063204765319824ms || by key: 0.00060391426086426ms
Output for 5.6.5
in_array: 0.00053691864013672ms || by key: 0.00053095817565918ms
Output for 5.6.4
in_array: 0.00063300132751465ms || by key: 0.00062704086303711ms
Output for 5.6.3
in_array: 0.0011420249938965ms || by key: 0.0011379718780518ms
Output for 5.6.2
in_array: 0.00059795379638672ms || by key: 0.00057196617126465ms
Output for 5.6.1
in_array: 0.00078511238098145ms || by key: 0.00073695182800293ms
Output for 5.6.0
in_array: 0.00064301490783691ms || by key: 0.00064301490783691ms
Output for 5.5.38
in_array: 0.00057506561279297ms || by key: 0.00058388710021973ms
Output for 5.5.37
in_array: 0.00060915946960449ms || by key: 0.00062990188598633ms
Output for 5.5.36
in_array: 0.00057291984558105ms || by key: 0.00054812431335449ms
Output for 5.5.35
in_array: 0.00067377090454102ms || by key: 0.00064492225646973ms
Output for 5.5.34
in_array: 0.0004279613494873ms || by key: 0.00046205520629883ms
Output for 5.5.33
in_array: 0.00045204162597656ms || by key: 0.00044989585876465ms
Output for 5.5.32
in_array: 0.00058698654174805ms || by key: 0.00056195259094238ms
Output for 5.5.31
in_array: 0.00045609474182129ms || by key: 0.00046610832214355ms
Output for 5.5.30
in_array: 0.0006260871887207ms || by key: 0.00055599212646484ms
Output for 5.5.29
in_array: 0.00059199333190918ms || by key: 0.00058889389038086ms
Output for 5.5.28
in_array: 0.00054812431335449ms || by key: 0.00053811073303223ms
Output for 5.5.27
in_array: 0.00047683715820312ms || by key: 0.00046896934509277ms
Output for 5.5.26
in_array: 0.00061297416687012ms || by key: 0.00061178207397461ms
Output for 5.5.25
in_array: 0.00045108795166016ms || by key: 0.00044608116149902ms
Output for 5.5.24
in_array: 0.00060081481933594ms || by key: 0.00054097175598145ms
Output for 5.5.23
in_array: 0.0006110668182373ms || by key: 0.00063300132751465ms
Output for 5.5.22
in_array: 0.00062298774719238ms || by key: 0.00062108039855957ms
Output for 5.5.21
in_array: 0.00060582160949707ms || by key: 0.00060105323791504ms
Output for 5.5.20
in_array: 0.00055503845214844ms || by key: 0.00054788589477539ms
Output for 5.5.19
in_array: 0.00049996376037598ms || by key: 0.0004878044128418ms
Output for 5.5.18
in_array: 0.0012478828430176ms || by key: 0.0010931491851807ms
Output for 5.5.16
in_array: 0.00052595138549805ms || by key: 0.00052499771118164ms
Output for 5.5.15
in_array: 0.00063896179199219ms || by key: 0.00063300132751465ms
Output for 5.5.14
in_array: 0.00053691864013672ms || by key: 0.0005640983581543ms
Output for 5.5.13
in_array: 0.00065922737121582ms || by key: 0.00069904327392578ms
Output for 5.5.12
in_array: 0.00052905082702637ms || by key: 0.00053000450134277ms
Output for 5.5.11
in_array: 0.00051999092102051ms || by key: 0.00051093101501465ms
Output for 5.5.10
in_array: 0.0006110668182373ms || by key: 0.00061321258544922ms
Output for 5.5.9
in_array: 0.00049495697021484ms || by key: 0.00050520896911621ms
Output for 5.5.8
in_array: 0.00056695938110352ms || by key: 0.0005800724029541ms
Output for 5.5.7
in_array: 0.00097799301147461ms || by key: 0.00095796585083008ms
Output for 5.5.6
in_array: 0.00044989585876465ms || by key: 0.00046300888061523ms
Output for 5.5.5
in_array: 0.00085806846618652ms || by key: 0.00085616111755371ms
Output for 5.5.4
in_array: 0.00064611434936523ms || by key: 0.00064206123352051ms
Output for 5.5.3
in_array: 0.00046610832214355ms || by key: 0.00047397613525391ms
Output for 5.5.2
in_array: 0.00062799453735352ms || by key: 0.00063896179199219ms
Output for 5.5.1
in_array: 0.00053811073303223ms || by key: 0.00053620338439941ms
Output for 5.5.0
in_array: 0.00055193901062012ms || by key: 0.00048613548278809ms
Output for 5.4.45
in_array: 0.00053691864013672ms || by key: 0.00053310394287109ms
Output for 5.4.44
in_array: 0.00058794021606445ms || by key: 0.00059008598327637ms
Output for 5.4.43
in_array: 0.00061511993408203ms || by key: 0.00069880485534668ms
Output for 5.4.42
in_array: 0.00055289268493652ms || by key: 0.00054287910461426ms
Output for 5.4.41
in_array: 0.00053501129150391ms || by key: 0.00052905082702637ms
Output for 5.4.40
in_array: 0.00058889389038086ms || by key: 0.0006260871887207ms
Output for 5.4.39
in_array: 0.00059103965759277ms || by key: 0.0005347728729248ms
Output for 5.4.38
in_array: 0.00046205520629883ms || by key: 0.00047612190246582ms
Output for 5.4.37
in_array: 0.00066399574279785ms || by key: 0.00061297416687012ms
Output for 5.4.36
in_array: 0.00047183036804199ms || by key: 0.0005028247833252ms
Output for 5.4.35
in_array: 0.00069212913513184ms || by key: 0.0006401538848877ms
Output for 5.4.34
in_array: 0.00045680999755859ms || by key: 0.00045990943908691ms
Output for 5.4.32
in_array: 0.00037407875061035ms || by key: 0.00040388107299805ms
Output for 5.4.31
in_array: 0.00060915946960449ms || by key: 0.00061392784118652ms
Output for 5.4.30
in_array: 0.00058197975158691ms || by key: 0.00058603286743164ms
Output for 5.4.29
in_array: 0.00066113471984863ms || by key: 0.00052714347839355ms
Output for 5.4.28
in_array: 0.00058197975158691ms || by key: 0.0005650520324707ms
Output for 5.4.27
in_array: 0.00059008598327637ms || by key: 0.00059103965759277ms
Output for 5.4.26
in_array: 0.00063204765319824ms || by key: 0.00066208839416504ms
Output for 5.4.25
in_array: 0.00056600570678711ms || by key: 0.00056600570678711ms
Output for 5.4.24
in_array: 0.000640869140625ms || by key: 0.00057601928710938ms
Output for 5.4.23
in_array: 0.00057315826416016ms || by key: 0.0005650520324707ms
Output for 5.4.22
in_array: 0.00056791305541992ms || by key: 0.00056982040405273ms
Output for 5.4.21
in_array: 0.00053095817565918ms || by key: 0.0005040168762207ms
Output for 5.4.20
in_array: 0.0005190372467041ms || by key: 0.00051712989807129ms
Output for 5.4.19
in_array: 0.00063204765319824ms || by key: 0.00060009956359863ms
Output for 5.4.18
in_array: 0.00047898292541504ms || by key: 0.00049281120300293ms
Output for 5.4.17
in_array: 0.0006718635559082ms || by key: 0.00066995620727539ms
Output for 5.4.16
in_array: 0.0006558895111084ms || by key: 0.00065207481384277ms
Output for 5.4.15
in_array: 0.00055480003356934ms || by key: 0.00056886672973633ms
Output for 5.4.14
in_array: 0.00051403045654297ms || by key: 0.00043988227844238ms
Output for 5.4.13
in_array: 0.00058698654174805ms || by key: 0.00058221817016602ms
Output for 5.4.12
in_array: 0.001237154006958ms || by key: 0.0012679100036621ms
Output for 5.4.11
in_array: 0.00060200691223145ms || by key: 0.00060009956359863ms
Output for 5.4.10
in_array: 0.0006568431854248ms || by key: 0.0006568431854248ms
Output for 5.4.9
in_array: 0.00059700012207031ms || by key: 0.00058889389038086ms
Output for 5.4.8
in_array: 0.00056600570678711ms || by key: 0.00058197975158691ms
Output for 5.4.7
in_array: 0.00061488151550293ms || by key: 0.00062012672424316ms
Output for 5.4.6
in_array: 0.0006260871887207ms || by key: 0.00065016746520996ms
Output for 5.4.5
in_array: 0.00059795379638672ms || by key: 0.00062203407287598ms
Output for 5.4.4
in_array: 0.00058102607727051ms || by key: 0.00060796737670898ms
Output for 5.4.3
in_array: 0.00058317184448242ms || by key: 0.00056004524230957ms
Output for 5.4.2
in_array: 0.00059390068054199ms || by key: 0.0005950927734375ms
Output for 5.4.1
in_array: 0.00051403045654297ms || by key: 0.0005190372467041ms
Output for 5.4.0
in_array: 0.00065302848815918ms || by key: 0.00064492225646973ms
Output for 5.3.29
in_array: 0.00078487396240234ms || by key: 0.00077486038208008ms
Output for 5.3.28
in_array: 0.00071096420288086ms || by key: 0.00069212913513184ms
Output for 5.3.27
in_array: 0.00076103210449219ms || by key: 0.00071597099304199ms
Output for 5.3.26
in_array: 0.00061488151550293ms || by key: 0.00060606002807617ms
Output for 5.3.25
in_array: 0.00069999694824219ms || by key: 0.00069499015808105ms
Output for 5.3.24
in_array: 0.0005190372467041ms || by key: 0.00052809715270996ms
Output for 5.3.23
in_array: 0.00058603286743164ms || by key: 0.00063085556030273ms
Output for 5.3.22
in_array: 0.00080585479736328ms || by key: 0.00082015991210938ms
Output for 5.3.21
in_array: 0.00049090385437012ms || by key: 0.00051093101501465ms
Output for 5.3.20
in_array: 0.00073409080505371ms || by key: 0.0007469654083252ms
Output for 5.3.19
in_array: 0.00059103965759277ms || by key: 0.00079703330993652ms
Output for 5.3.18
in_array: 0.00074195861816406ms || by key: 0.00072097778320312ms
Output for 5.3.17
in_array: 0.00084400177001953ms || by key: 0.00079202651977539ms
Output for 5.3.16
in_array: 0.00076007843017578ms || by key: 0.00075292587280273ms
Output for 5.3.15
in_array: 0.00067400932312012ms || by key: 0.0006561279296875ms
Output for 5.3.14
in_array: 0.00088286399841309ms || by key: 0.00082993507385254ms
Output for 5.3.13
in_array: 0.00076198577880859ms || by key: 0.00075507164001465ms
Output for 5.3.12
in_array: 0.00064706802368164ms || by key: 0.0007321834564209ms
Output for 5.3.11
in_array: 0.00076103210449219ms || by key: 0.00077295303344727ms
Output for 5.3.10
in_array: 0.00080394744873047ms || by key: 0.00079512596130371ms
Output for 5.3.9
in_array: 0.00075197219848633ms || by key: 0.00081610679626465ms
Output for 5.3.8
in_array: 0.00082182884216309ms || by key: 0.00070095062255859ms
Output for 5.3.7
in_array: 0.00067901611328125ms || by key: 0.00065898895263672ms
Output for 5.3.6
in_array: 0.00074505805969238ms || by key: 0.00068402290344238ms
Output for 5.3.5
in_array: 0.00064277648925781ms || by key: 0.00065112113952637ms
Output for 5.3.4
in_array: 0.00076794624328613ms || by key: 0.00075387954711914ms
Output for 5.3.3
in_array: 0.00066399574279785ms || by key: 0.00068998336791992ms
Output for 5.3.2
in_array: 0.00089287757873535ms || by key: 0.00084495544433594ms
Output for 5.3.1
in_array: 0.00061202049255371ms || by key: 0.00059604644775391ms
Output for 5.3.0
in_array: 0.00059914588928223ms || by key: 0.00048613548278809ms
Output for 5.2.17
in_array: 0.00069594383239746ms || by key: 0.00085306167602539ms
Output for 5.2.16
in_array: 0.00073099136352539ms || by key: 0.00071597099304199ms
Output for 5.2.15
in_array: 0.00086593627929688ms || by key: 0.000946044921875ms
Output for 5.2.14
in_array: 0.00068807601928711ms || by key: 0.00067782402038574ms
Output for 5.2.13
in_array: 0.00081896781921387ms || by key: 0.00076103210449219ms
Output for 5.2.12
in_array: 0.00054597854614258ms || by key: 0.00052499771118164ms
Output for 5.2.11
in_array: 0.00049686431884766ms || by key: 0.00049090385437012ms
Output for 5.2.10
in_array: 0.0005030632019043ms || by key: 0.00049996376037598ms
Output for 5.2.9
in_array: 0.00086498260498047ms || by key: 0.00088715553283691ms
Output for 5.2.8
in_array: 0.00058603286743164ms || by key: 0.00058197975158691ms
Output for 5.2.7
in_array: 0.00081300735473633ms || by key: 0.00081706047058105ms
Output for 5.2.6
in_array: 0.00050711631774902ms || by key: 0.0005040168762207ms
Output for 5.2.5
in_array: 0.00051307678222656ms || by key: 0.00051403045654297ms
Output for 5.2.4
in_array: 0.00053310394287109ms || by key: 0.00050616264343262ms
Output for 5.2.3
in_array: 0.00056886672973633ms || by key: 0.00055718421936035ms
Output for 5.2.2
in_array: 0.00055408477783203ms || by key: 0.00058412551879883ms
Output for 5.2.1
in_array: 0.00052499771118164ms || by key: 0.00051999092102051ms
Output for 5.2.0
in_array: 0.00050687789916992ms || by key: 0.00049114227294922ms
Output for 5.1.6
in_array: 0.00076603889465332ms || by key: 0.00075697898864746ms
Output for 5.1.5
in_array: 0.00085997581481934ms || by key: 0.00086116790771484ms
Output for 5.1.4
in_array: 0.00050902366638184ms || by key: 0.0005030632019043ms
Output for 5.1.3
in_array: 0.00052595138549805ms || by key: 0.00053215026855469ms
Output for 5.1.2
in_array: 0.00049901008605957ms || by key: 0.00049185752868652ms
Output for 5.1.1
in_array: 0.00052905082702637ms || by key: 0.00052881240844727ms
Output for 5.1.0
in_array: 0.00060296058654785ms || by key: 0.00057101249694824ms
Output for 5.0.5
in_array: 0.00058794021606445ms || by key: 0.00049304962158203ms
Output for 5.0.4
in_array: 0.0010309219360352ms || by key: 0.00082707405090332ms
Output for 5.0.3
in_array: 0.00045204162597656ms || by key: 0.00044608116149902ms
Output for 5.0.2
in_array: 0.00045609474182129ms || by key: 0.00044488906860352ms
Output for 5.0.1
in_array: 0.00044894218444824ms || by key: 0.00043821334838867ms
Output for 5.0.0
in_array: 0.00050687789916992ms || by key: 0.00052189826965332ms
Output for 4.4.9
in_array: 0.000609ms || by key: 0.000636ms
Output for 4.4.8
in_array: 0.000477ms || by key: 0.000465ms
Output for 4.4.7
in_array: 0.000548ms || by key: 0.000522ms
Output for 4.4.6
in_array: 0.000574ms || by key: 0.000561ms
Output for 4.4.5
in_array: 0.000475ms || by key: 0.000464ms
Output for 4.4.4
in_array: 0.000524ms || by key: 0.000557ms
Output for 4.4.3
in_array: 0.001071ms || by key: 0.001081ms
Output for 4.4.2
in_array: 0.00049ms || by key: 0.000491ms
Output for 4.4.1
in_array: 0.000503ms || by key: 0.000527ms
Output for 4.4.0
in_array: 0.000512ms || by key: 0.000617ms
Output for 4.3.11
in_array: 0.000259ms || by key: 0.000247ms
Output for 4.3.10
in_array: 0.000548ms || by key: 0.000561ms
Output for 4.3.9
in_array: 0.000639ms || by key: 0.000657ms
Output for 4.3.8
in_array: 0.000565ms || by key: 0.000553ms
Output for 4.3.7
in_array: 0.000553ms || by key: 0.000566ms
Output for 4.3.6
in_array: 0.000553ms || by key: 0.000554ms
Output for 4.3.5
in_array: 0.000564ms || by key: 0.000579ms
Output for 4.3.4
in_array: 0.000683ms || by key: 0.000687ms
Output for 4.3.3
in_array: 0.000556ms || by key: 0.000544ms
Output for 4.3.2
in_array: 0.000589ms || by key: 0.000685ms
Output for 4.3.1
in_array: 0.000552ms || by key: 0.000544ms
Output for 4.3.0
in_array: 0.000591ms || by key: 0.000616ms