3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(0); $start = microtime(true); for($i = 0; $i < 10000; $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 < 10000; $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 OoSjl
Output for 7.2.0
in_array: 0.0062081813812256ms || by key: 0.0062260627746582ms
Output for 7.1.7
in_array: 0.0039389133453369ms || by key: 0.0040490627288818ms
Output for 7.1.6
in_array: 0.007904052734375ms || by key: 0.0073471069335938ms
Output for 7.1.5
in_array: 0.0078630447387695ms || by key: 0.0074639320373535ms
Output for 7.1.0
in_array: 0.006627082824707ms || by key: 0.0064659118652344ms
Output for 7.0.20
in_array: 0.0044498443603516ms || by key: 0.0041542053222656ms
Output for 7.0.14
in_array: 0.0062739849090576ms || by key: 0.0062799453735352ms
Output for 7.0.11
in_array: 0.0034279823303223ms || by key: 0.003713846206665ms
Output for 7.0.10
in_array: 0.0033919811248779ms || by key: 0.0033349990844727ms
Output for 7.0.9
in_array: 0.0051901340484619ms || by key: 0.0051710605621338ms
Output for 7.0.8
in_array: 0.0042598247528076ms || by key: 0.0042448043823242ms
Output for 7.0.7
in_array: 0.0056560039520264ms || by key: 0.0055961608886719ms
Output for 7.0.6
in_array: 0.0046288967132568ms || by key: 0.0044660568237305ms
Output for 7.0.5
in_array: 0.0046689510345459ms || by key: 0.0037729740142822ms
Output for 7.0.4
in_array: 0.0055370330810547ms || by key: 0.0053720474243164ms
Output for 7.0.3
in_array: 0.0043680667877197ms || by key: 0.004680871963501ms
Output for 7.0.2
in_array: 0.004486083984375ms || by key: 0.003554105758667ms
Output for 7.0.1
in_array: 0.0043959617614746ms || by key: 0.0043988227844238ms
Output for 7.0.0
in_array: 0.0041289329528809ms || by key: 0.0040462017059326ms
Output for 5.6.28
in_array: 0.0078690052032471ms || by key: 0.0076239109039307ms
Output for 5.6.26
in_array: 0.0036680698394775ms || by key: 0.0036718845367432ms
Output for 5.6.25
in_array: 0.0041830539703369ms || by key: 0.0041570663452148ms
Output for 5.6.24
in_array: 0.004209041595459ms || by key: 0.0036709308624268ms
Output for 5.6.23
in_array: 0.0057919025421143ms || by key: 0.005620002746582ms
Output for 5.6.22
in_array: 0.0050671100616455ms || by key: 0.0049400329589844ms
Output for 5.6.21
in_array: 0.0051889419555664ms || by key: 0.0050039291381836ms
Output for 5.6.20
in_array: 0.006105899810791ms || by key: 0.005073070526123ms
Output for 5.6.19
in_array: 0.0058200359344482ms || by key: 0.0057101249694824ms
Output for 5.6.18
in_array: 0.0051748752593994ms || by key: 0.0051581859588623ms
Output for 5.6.17
in_array: 0.0045509338378906ms || by key: 0.0045781135559082ms
Output for 5.6.16
in_array: 0.0053861141204834ms || by key: 0.0042281150817871ms
Output for 5.6.15
in_array: 0.0079989433288574ms || by key: 0.0087540149688721ms
Output for 5.6.14
in_array: 0.0055298805236816ms || by key: 0.0053141117095947ms
Output for 5.6.13
in_array: 0.0077488422393799ms || by key: 0.0073568820953369ms
Output for 5.6.12
in_array: 0.0042979717254639ms || by key: 0.0044591426849365ms
Output for 5.6.11
in_array: 0.0086939334869385ms || by key: 0.0087540149688721ms
Output for 5.6.10
in_array: 0.0055379867553711ms || by key: 0.004490852355957ms
Output for 5.6.9
in_array: 0.0041859149932861ms || by key: 0.0046558380126953ms
Output for 5.6.8
in_array: 0.0053210258483887ms || by key: 0.0051279067993164ms
Output for 5.6.7
in_array: 0.0056679248809814ms || by key: 0.0053200721740723ms
Output for 5.6.6
in_array: 0.0062909126281738ms || by key: 0.0061330795288086ms
Output for 5.6.5
in_array: 0.0065500736236572ms || by key: 0.0061771869659424ms
Output for 5.6.4
in_array: 0.0061800479888916ms || by key: 0.0061969757080078ms
Output for 5.6.3
in_array: 0.0044128894805908ms || by key: 0.0043809413909912ms
Output for 5.6.2
in_array: 0.0086600780487061ms || by key: 0.0079169273376465ms
Output for 5.6.1
in_array: 0.0043399333953857ms || by key: 0.0047581195831299ms
Output for 5.6.0
in_array: 0.0046920776367188ms || by key: 0.0047798156738281ms
Output for 5.5.38
in_array: 0.0050828456878662ms || by key: 0.005033016204834ms
Output for 5.5.37
in_array: 0.0060200691223145ms || by key: 0.006321907043457ms
Output for 5.5.36
in_array: 0.005033016204834ms || by key: 0.0055861473083496ms
Output for 5.5.35
in_array: 0.0050480365753174ms || by key: 0.00496506690979ms
Output for 5.5.34
in_array: 0.0053229331970215ms || by key: 0.0040328502655029ms
Output for 5.5.33
in_array: 0.0071430206298828ms || by key: 0.0068299770355225ms
Output for 5.5.32
in_array: 0.0043208599090576ms || by key: 0.0043380260467529ms
Output for 5.5.31
in_array: 0.0050780773162842ms || by key: 0.0047309398651123ms
Output for 5.5.30
in_array: 0.005079984664917ms || by key: 0.0043771266937256ms
Output for 5.5.29
in_array: 0.0037751197814941ms || by key: 0.0037939548492432ms
Output for 5.5.28
in_array: 0.0048348903656006ms || by key: 0.0050201416015625ms
Output for 5.5.27
in_array: 0.0051999092102051ms || by key: 0.00518798828125ms
Output for 5.5.26
in_array: 0.0051331520080566ms || by key: 0.005169153213501ms
Output for 5.5.25
in_array: 0.0049891471862793ms || by key: 0.0048789978027344ms
Output for 5.5.24
in_array: 0.0058729648590088ms || by key: 0.0057928562164307ms
Output for 5.5.23
in_array: 0.0064771175384521ms || by key: 0.0065140724182129ms
Output for 5.5.22
in_array: 0.0049889087677002ms || by key: 0.0050768852233887ms
Output for 5.5.21
in_array: 0.0050158500671387ms || by key: 0.0049111843109131ms
Output for 5.5.20
in_array: 0.0044760704040527ms || by key: 0.0044670104980469ms
Output for 5.5.19
in_array: 0.0057399272918701ms || by key: 0.0045540332794189ms
Output for 5.5.18
in_array: 0.004594087600708ms || by key: 0.004594087600708ms
Output for 5.5.16
in_array: 0.0055410861968994ms || by key: 0.0048379898071289ms
Output for 5.5.15
in_array: 0.0056908130645752ms || by key: 0.0048279762268066ms
Output for 5.5.14
in_array: 0.0054199695587158ms || by key: 0.005612850189209ms
Output for 5.5.13
in_array: 0.0052170753479004ms || by key: 0.0051429271697998ms
Output for 5.5.12
in_array: 0.0054290294647217ms || by key: 0.0072729587554932ms
Output for 5.5.11
in_array: 0.006058931350708ms || by key: 0.0059759616851807ms
Output for 5.5.10
in_array: 0.0058791637420654ms || by key: 0.0048928260803223ms
Output for 5.5.9
in_array: 0.0064029693603516ms || by key: 0.0060558319091797ms
Output for 5.5.8
in_array: 0.0054080486297607ms || by key: 0.0043301582336426ms
Output for 5.5.7
in_array: 0.005634069442749ms || by key: 0.0048038959503174ms
Output for 5.5.6
in_array: 0.0045950412750244ms || by key: 0.0045838356018066ms
Output for 5.5.5
in_array: 0.0055990219116211ms || by key: 0.005504846572876ms
Output for 5.5.4
in_array: 0.0051867961883545ms || by key: 0.0056641101837158ms
Output for 5.5.3
in_array: 0.0057201385498047ms || by key: 0.0057978630065918ms
Output for 5.5.2
in_array: 0.0054390430450439ms || by key: 0.005295991897583ms
Output for 5.5.1
in_array: 0.0053629875183105ms || by key: 0.0052471160888672ms
Output for 5.5.0
in_array: 0.0062010288238525ms || by key: 0.0046980381011963ms
Output for 5.4.45
in_array: 0.0061349868774414ms || by key: 0.0059659481048584ms
Output for 5.4.44
in_array: 0.0048961639404297ms || by key: 0.0048129558563232ms
Output for 5.4.43
in_array: 0.0048379898071289ms || by key: 0.0050630569458008ms
Output for 5.4.42
in_array: 0.0053081512451172ms || by key: 0.0053920745849609ms
Output for 5.4.41
in_array: 0.0055789947509766ms || by key: 0.0057828426361084ms
Output for 5.4.40
in_array: 0.0047729015350342ms || by key: 0.0046169757843018ms
Output for 5.4.39
in_array: 0.0056979656219482ms || by key: 0.0055339336395264ms
Output for 5.4.38
in_array: 0.0052249431610107ms || by key: 0.0055849552154541ms
Output for 5.4.37
in_array: 0.0060889720916748ms || by key: 0.0058481693267822ms
Output for 5.4.36
in_array: 0.0059971809387207ms || by key: 0.0058209896087646ms
Output for 5.4.35
in_array: 0.0057981014251709ms || by key: 0.0055279731750488ms
Output for 5.4.34
in_array: 0.0049021244049072ms || by key: 0.004457950592041ms
Output for 5.4.32
in_array: 0.0057220458984375ms || by key: 0.0058178901672363ms
Output for 5.4.31
in_array: 0.0061600208282471ms || by key: 0.0061280727386475ms
Output for 5.4.30
in_array: 0.0060451030731201ms || by key: 0.0051090717315674ms
Output for 5.4.29
in_array: 0.0061600208282471ms || by key: 0.0059239864349365ms
Output for 5.4.28
in_array: 0.0056121349334717ms || by key: 0.0053441524505615ms
Output for 5.4.27
in_array: 0.0053749084472656ms || by key: 0.005446195602417ms
Output for 5.4.26
in_array: 0.0062940120697021ms || by key: 0.0063698291778564ms
Output for 5.4.25
in_array: 0.0046429634094238ms || by key: 0.0048220157623291ms
Output for 5.4.24
in_array: 0.0058519840240479ms || by key: 0.0050480365753174ms
Output for 5.4.23
in_array: 0.0054609775543213ms || by key: 0.0055160522460938ms
Output for 5.4.22
in_array: 0.0046000480651855ms || by key: 0.0041608810424805ms
Output for 5.4.21
in_array: 0.0055208206176758ms || by key: 0.0050849914550781ms
Output for 5.4.20
in_array: 0.0062389373779297ms || by key: 0.0049519538879395ms
Output for 5.4.19
in_array: 0.0049970149993896ms || by key: 0.0051360130310059ms
Output for 5.4.18
in_array: 0.0057148933410645ms || by key: 0.005742073059082ms
Output for 5.4.17
in_array: 0.0060138702392578ms || by key: 0.0058860778808594ms
Output for 5.4.16
in_array: 0.0061688423156738ms || by key: 0.0058619976043701ms
Output for 5.4.15
in_array: 0.0066239833831787ms || by key: 0.005281925201416ms
Output for 5.4.14
in_array: 0.0057709217071533ms || by key: 0.0062260627746582ms
Output for 5.4.13
in_array: 0.0052478313446045ms || by key: 0.0044808387756348ms
Output for 5.4.12
in_array: 0.0049049854278564ms || by key: 0.004979133605957ms
Output for 5.4.11
in_array: 0.0062699317932129ms || by key: 0.0063810348510742ms
Output for 5.4.10
in_array: 0.004317045211792ms || by key: 0.0041129589080811ms
Output for 5.4.9
in_array: 0.0094292163848877ms || by key: 0.0087800025939941ms
Output for 5.4.8
in_array: 0.0067059993743896ms || by key: 0.0056040287017822ms
Output for 5.4.7
in_array: 0.0066218376159668ms || by key: 0.0064070224761963ms
Output for 5.4.6
in_array: 0.0054988861083984ms || by key: 0.0059409141540527ms
Output for 5.4.5
in_array: 0.0046892166137695ms || by key: 0.005363941192627ms
Output for 5.4.4
in_array: 0.0046021938323975ms || by key: 0.0047900676727295ms
Output for 5.4.3
in_array: 0.0057179927825928ms || by key: 0.0058259963989258ms
Output for 5.4.2
in_array: 0.006511926651001ms || by key: 0.0062949657440186ms
Output for 5.4.1
in_array: 0.006213903427124ms || by key: 0.0062100887298584ms
Output for 5.4.0
in_array: 0.0064709186553955ms || by key: 0.0061030387878418ms
Output for 5.3.29
in_array: 0.0056140422821045ms || by key: 0.0053060054779053ms
Output for 5.3.28
in_array: 0.0055220127105713ms || by key: 0.0054688453674316ms
Output for 5.3.27
in_array: 0.0056400299072266ms || by key: 0.0055780410766602ms
Output for 5.3.26
in_array: 0.0068149566650391ms || by key: 0.0059819221496582ms
Output for 5.3.25
in_array: 0.0068068504333496ms || by key: 0.0053021907806396ms
Output for 5.3.24
in_array: 0.0066139698028564ms || by key: 0.0063900947570801ms
Output for 5.3.23
in_array: 0.0062108039855957ms || by key: 0.0059280395507812ms
Output for 5.3.22
in_array: 0.0063948631286621ms || by key: 0.0053989887237549ms
Output for 5.3.21
in_array: 0.0064678192138672ms || by key: 0.0065450668334961ms
Output for 5.3.20
in_array: 0.0064809322357178ms || by key: 0.0065550804138184ms
Output for 5.3.19
in_array: 0.0067319869995117ms || by key: 0.0067288875579834ms
Output for 5.3.18
in_array: 0.0069499015808105ms || by key: 0.0067291259765625ms
Output for 5.3.17
in_array: 0.0064330101013184ms || by key: 0.0062160491943359ms
Output for 5.3.16
in_array: 0.0049569606781006ms || by key: 0.0048689842224121ms
Output for 5.3.15
in_array: 0.0067079067230225ms || by key: 0.0064311027526855ms
Output for 5.3.14
in_array: 0.0063729286193848ms || by key: 0.006850004196167ms
Output for 5.3.13
in_array: 0.0057880878448486ms || by key: 0.0046660900115967ms
Output for 5.3.12
in_array: 0.0069160461425781ms || by key: 0.0067651271820068ms
Output for 5.3.11
in_array: 0.0057101249694824ms || by key: 0.005748987197876ms
Output for 5.3.10
in_array: 0.0069520473480225ms || by key: 0.0069210529327393ms
Output for 5.3.9
in_array: 0.0062530040740967ms || by key: 0.0062589645385742ms
Output for 5.3.8
in_array: 0.006458044052124ms || by key: 0.0063550472259521ms
Output for 5.3.7
in_array: 0.0068070888519287ms || by key: 0.0066220760345459ms
Output for 5.3.6
in_array: 0.0053579807281494ms || by key: 0.0054161548614502ms
Output for 5.3.5
in_array: 0.005295991897583ms || by key: 0.0055220127105713ms
Output for 5.3.4
in_array: 0.0068068504333496ms || by key: 0.0065200328826904ms
Output for 5.3.3
in_array: 0.0062699317932129ms || by key: 0.0047369003295898ms
Output for 5.3.2
in_array: 0.0040829181671143ms || by key: 0.0042469501495361ms
Output for 5.3.1
in_array: 0.0064990520477295ms || by key: 0.0070641040802002ms
Output for 5.3.0
in_array: 0.0074920654296875ms || by key: 0.006166934967041ms
Output for 5.2.17
in_array: 0.006605863571167ms || by key: 0.0066299438476562ms
Output for 5.2.16
in_array: 0.0062658786773682ms || by key: 0.0064389705657959ms
Output for 5.2.15
in_array: 0.0054728984832764ms || by key: 0.0055501461029053ms
Output for 5.2.14
in_array: 0.0060818195343018ms || by key: 0.0060920715332031ms
Output for 5.2.13
in_array: 0.0072638988494873ms || by key: 0.0070269107818604ms
Output for 5.2.12
in_array: 0.0081119537353516ms || by key: 0.007789134979248ms
Output for 5.2.11
in_array: 0.0075709819793701ms || by key: 0.0072970390319824ms
Output for 5.2.10
in_array: 0.0077109336853027ms || by key: 0.007288932800293ms
Output for 5.2.9
in_array: 0.007659912109375ms || by key: 0.0078039169311523ms
Output for 5.2.8
in_array: 0.0076799392700195ms || by key: 0.0075111389160156ms
Output for 5.2.7
in_array: 0.0075781345367432ms || by key: 0.0072090625762939ms
Output for 5.2.6
in_array: 0.0078108310699463ms || by key: 0.0065159797668457ms
Output for 5.2.5
in_array: 0.0077049732208252ms || by key: 0.0075199604034424ms
Output for 5.2.4
in_array: 0.0061039924621582ms || by key: 0.0061419010162354ms
Output for 5.2.3
in_array: 0.0062210559844971ms || by key: 0.0060079097747803ms
Output for 5.2.2
in_array: 0.0084919929504395ms || by key: 0.0081319808959961ms
Output for 5.2.1
in_array: 0.0075027942657471ms || by key: 0.0060830116271973ms
Output for 5.2.0
in_array: 0.0064139366149902ms || by key: 0.0065410137176514ms
Output for 5.1.6
in_array: 0.0062119960784912ms || by key: 0.0060920715332031ms
Output for 5.1.5
in_array: 0.0087511539459229ms || by key: 0.0076501369476318ms
Output for 5.1.4
in_array: 0.0078699588775635ms || by key: 0.0066850185394287ms
Output for 5.1.3
in_array: 0.0064570903778076ms || by key: 0.0065090656280518ms
Output for 5.1.2
in_array: 0.0072901248931885ms || by key: 0.0059750080108643ms
Output for 5.1.1
in_array: 0.007429838180542ms || by key: 0.0072898864746094ms
Output for 5.1.0
in_array: 0.0079488754272461ms || by key: 0.0076389312744141ms
Output for 5.0.5
in_array: 0.0064139366149902ms || by key: 0.005687952041626ms
Output for 5.0.4
in_array: 0.0074198246002197ms || by key: 0.0069868564605713ms
Output for 5.0.3
in_array: 0.0057449340820312ms || by key: 0.0055370330810547ms
Output for 5.0.2
in_array: 0.007436990737915ms || by key: 0.0072319507598877ms
Output for 5.0.1
in_array: 0.0071089267730713ms || by key: 0.0070040225982666ms
Output for 5.0.0
in_array: 0.0062580108642578ms || by key: 0.0060999393463135ms
Output for 4.4.9
in_array: 0.007972ms || by key: 0.007724ms
Output for 4.4.8
in_array: 0.007842ms || by key: 0.007722ms
Output for 4.4.7
in_array: 0.008195ms || by key: 0.008154ms
Output for 4.4.6
in_array: 0.007635ms || by key: 0.007408ms
Output for 4.4.5
in_array: 0.007824ms || by key: 0.008021ms
Output for 4.4.4
in_array: 0.008609ms || by key: 0.007793ms
Output for 4.4.3
in_array: 0.008702ms || by key: 0.008618ms
Output for 4.4.2
in_array: 0.009236ms || by key: 0.008733ms
Output for 4.4.1
in_array: 0.008231ms || by key: 0.00767ms
Output for 4.4.0
in_array: 0.006806ms || by key: 0.006102ms
Output for 4.3.11
in_array: 0.003144ms || by key: 0.002956ms
Output for 4.3.10
in_array: 0.0101ms || by key: 0.009706ms
Output for 4.3.9
in_array: 0.010066ms || by key: 0.009634ms
Output for 4.3.8
in_array: 0.009201ms || by key: 0.008749ms
Output for 4.3.7
in_array: 0.009983ms || by key: 0.009569ms
Output for 4.3.6
in_array: 0.008852ms || by key: 0.008361ms
Output for 4.3.5
in_array: 0.010041ms || by key: 0.009727ms
Output for 4.3.4
in_array: 0.008376ms || by key: 0.006846ms
Output for 4.3.3
in_array: 0.009932ms || by key: 0.00959ms
Output for 4.3.2
in_array: 0.011287ms || by key: 0.00958ms
Output for 4.3.1
in_array: 0.009304ms || by key: 0.009227ms
Output for 4.3.0
in_array: 0.009302ms || by key: 0.008514ms