3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = range(0, 10000); $time = microtime(true); $b = array_filter($a, function($el) { return $el % 2 === 0; }); var_dump(microtime(true) - $time); $b = []; $time = microtime(true); foreach ($a as $el) { if ($el % 2 === 0) { $b[] = $el; } } var_dump(microtime(true) - $time);
Output for 7.1.7
float(0.0013918876647949) float(0.00067305564880371)
Output for 7.1.6
float(0.00053906440734863) float(0.0002899169921875)
Output for 7.1.5
float(0.00084686279296875) float(0.00032877922058105)
Output for 7.1.0
float(0.00052905082702637) float(0.00026893615722656)
Output for 7.0.20
float(0.0013480186462402) float(0.0006859302520752)
Output for 7.0.14
float(0.0010499954223633) float(0.00052499771118164)
Output for 7.0.12
float(0.0010089874267578) float(0.00051116943359375)
Output for 7.0.6
float(0.0015451908111572) float(0.00044703483581543)
Output for 7.0.5
float(0.0014798641204834) float(0.00046491622924805)
Output for 7.0.4
float(0.00085282325744629) float(0.00029110908508301)
Output for 7.0.3
float(0.00081586837768555) float(0.00029397010803223)
Output for 7.0.2
float(0.00088286399841309) float(0.00030994415283203)
Output for 7.0.1
float(0.0011880397796631) float(0.00052809715270996)
Output for 7.0.0
float(0.0011701583862305) float(0.00042414665222168)
Output for 5.6.28
float(0.0028610229492188) float(0.0011599063873291)
Output for 5.6.21
float(0.0029358863830566) float(0.00146484375)
Output for 5.6.20
float(0.0017330646514893) float(0.00069904327392578)
Output for 5.6.19
float(0.0017051696777344) float(0.0006721019744873)
Output for 5.6.18
float(0.0019271373748779) float(0.00077295303344727)
Output for 5.6.17
float(0.0017209053039551) float(0.00068306922912598)
Output for 5.6.16
float(0.0017268657684326) float(0.00070405006408691)
Output for 5.6.15
float(0.0026781558990479) float(0.0010750293731689)
Output for 5.6.14
float(0.0024750232696533) float(0.00098896026611328)
Output for 5.6.13
float(0.0024650096893311) float(0.00097799301147461)
Output for 5.6.12
float(0.0019509792327881) float(0.00077605247497559)
Output for 5.6.11
float(0.0017280578613281) float(0.00069999694824219)
Output for 5.6.10
float(0.0026898384094238) float(0.0010228157043457)
Output for 5.6.9
float(0.0024518966674805) float(0.0010001659393311)
Output for 5.6.8
float(0.0027921199798584) float(0.0010988712310791)
Output for 5.5.35
float(0.0030181407928467) float(0.0010809898376465)
Output for 5.5.34
float(0.0026168823242188) float(0.0010621547698975)
Output for 5.5.33
float(0.0021979808807373) float(0.0009160041809082)
Output for 5.5.32
float(0.0016040802001953) float(0.00070095062255859)
Output for 5.5.31
float(0.0023429393768311) float(0.00099992752075195)
Output for 5.5.30
float(0.0027618408203125) float(0.0011050701141357)
Output for 5.5.29
float(0.0020599365234375) float(0.0010690689086914)
Output for 5.5.28
float(0.0030431747436523) float(0.0012500286102295)
Output for 5.5.27
float(0.0020370483398438) float(0.0009160041809082)
Output for 5.5.26
float(0.0025019645690918) float(0.0010910034179688)
Output for 5.5.25
float(0.0017969608306885) float(0.00073885917663574)
Output for 5.5.24
float(0.002589225769043) float(0.0010519027709961)
Output for 5.4.45
float(0.0015840530395508) float(0.00067901611328125)
Output for 5.4.44
float(0.0018100738525391) float(0.00083804130554199)
Output for 5.4.43
float(0.0016028881072998) float(0.00066900253295898)
Output for 5.4.42
float(0.0016021728515625) float(0.00066995620727539)
Output for 5.4.41
float(0.0015740394592285) float(0.00069022178649902)
Output for 5.4.40
float(0.0025601387023926) float(0.0011050701141357)
Output for 5.4.39
float(0.0022358894348145) float(0.0010590553283691)
Output for 5.4.38
float(0.0024900436401367) float(0.0011820793151855)
Output for 5.4.37
float(0.0027079582214355) float(0.0010509490966797)
Output for 5.4.36
float(0.0038621425628662) float(0.00111985206604)
Output for 5.4.35
float(0.002161979675293) float(0.00096797943115234)
Output for 5.4.34
float(0.0026168823242188) float(0.0011379718780518)
Output for 5.4.32
float(0.0025870800018311) float(0.001121997833252)
Output for 5.4.31
float(0.0025110244750977) float(0.0010101795196533)
Output for 5.4.30
float(0.0024731159210205) float(0.0010700225830078)
Output for 5.4.29
float(0.0025341510772705) float(0.0012140274047852)
Output for 5.4.28
float(0.0032708644866943) float(0.0011298656463623)
Output for 5.4.27
float(0.0025639533996582) float(0.0010888576507568)
Output for 5.4.26
float(0.0022530555725098) float(0.00079584121704102)
Output for 5.4.25
float(0.0023918151855469) float(0.001025915145874)
Output for 5.4.24
float(0.002363920211792) float(0.00096702575683594)
Output for 5.4.23
float(0.001939058303833) float(0.00085902214050293)
Output for 5.4.22
float(0.0026321411132812) float(0.0012359619140625)
Output for 5.4.21
float(0.00166916847229) float(0.00075197219848633)
Output for 5.4.20
float(0.0016851425170898) float(0.00074601173400879)
Output for 5.4.19
float(0.0030779838562012) float(0.0011260509490967)
Output for 5.4.18
float(0.002094030380249) float(0.0009310245513916)
Output for 5.4.17
float(0.002716064453125) float(0.0011439323425293)
Output for 5.4.16
float(0.0025079250335693) float(0.00080204010009766)
Output for 5.4.15
float(0.0024919509887695) float(0.00078511238098145)
Output for 5.4.14
float(0.0023818016052246) float(0.00099396705627441)
Output for 5.4.13
float(0.002730131149292) float(0.0010838508605957)
Output for 5.4.12
float(0.0027830600738525) float(0.0011441707611084)
Output for 5.4.11
float(0.0028707981109619) float(0.0010631084442139)
Output for 5.4.10
float(0.0027201175689697) float(0.0011730194091797)
Output for 5.4.9
float(0.0026600360870361) float(0.0010569095611572)
Output for 5.4.8
float(0.0025830268859863) float(0.0012078285217285)
Output for 5.4.7
float(0.0025029182434082) float(0.0010669231414795)
Output for 5.4.6
float(0.002133846282959) float(0.0010170936584473)
Output for 5.4.5
float(0.0023200511932373) float(0.00098991394042969)
Output for 5.4.4
float(0.0020909309387207) float(0.00088286399841309)
Output for 5.4.3
float(0.0018341541290283) float(0.00082707405090332)
Output for 5.4.2
float(0.0022320747375488) float(0.00091099739074707)
Output for 5.4.1
float(0.0017108917236328) float(0.00070905685424805)
Output for 5.4.0
float(0.001939058303833) float(0.00086307525634766)
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/XsW97 on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/XsW97 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 T_FUNCTION in /in/XsW97 on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/XsW97 on line 7
Process exited with code 255.