3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(0, 100000); $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);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.4.00.0130.02022.26
7.3.120.0160.02622.21
7.3.110.0130.02222.09
7.3.100.0160.01622.25
7.3.90.0070.02322.22
7.3.80.0070.02422.23
7.3.70.0100.01722.45
7.3.60.0170.01022.37
7.3.50.0070.02022.04
7.3.40.0070.02322.39
7.3.30.0070.02322.31
7.3.20.0060.01924.32
7.3.10.0070.01824.65
7.3.00.0130.01724.58
7.2.250.0100.03521.68
7.2.240.0070.02422.01
7.2.230.0070.02222.04
7.2.220.0200.01021.91
7.2.210.0130.01321.91
7.2.200.0100.02021.77
7.2.190.0000.02721.95
7.2.180.0090.02221.98
7.2.170.0100.01721.92
7.2.130.0160.02024.52
7.2.120.0150.02024.74
7.2.110.0130.01824.42
7.2.100.0150.01824.53
7.2.90.0120.01724.60
7.2.80.0150.01824.66
7.2.70.0140.01924.48
7.2.60.0150.01824.56
7.2.50.0100.02024.79
7.2.40.0120.01924.64
7.2.30.0130.02024.54
7.2.20.0140.01824.71
7.2.10.0130.01824.57
7.2.00.0090.02025.41
7.1.330.0030.03023.58
7.1.320.0070.02123.72
7.1.310.0060.02623.61
7.1.300.0070.02423.43
7.1.290.0100.01723.61
7.1.280.0150.01523.70
7.1.270.0170.01323.41
7.1.260.0070.02523.57
7.1.250.0200.01623.45
7.1.240.0240.03423.62
7.1.230.0210.02123.77
7.1.220.0290.01623.69
7.1.210.0190.01923.77
7.1.200.0280.01623.70
7.1.190.0170.02723.28
7.1.180.0170.02723.73
7.1.170.0220.01623.39
7.1.160.0160.02323.50
7.1.150.0200.02323.70
7.1.140.0160.02623.46
7.1.130.0130.02523.20
7.1.120.0140.02123.68
7.1.110.0200.02723.68
7.1.100.0250.01923.66
7.1.90.0160.02923.55
7.1.80.0240.02023.34
7.1.70.0130.02324.30
7.1.60.0130.03324.30
7.1.50.0090.02224.29
7.1.40.0100.03123.75
7.1.30.0100.03123.37
7.1.20.0130.03323.54
7.1.10.0140.02423.66
7.1.00.0170.05726.94
7.0.330.0270.03123.55
7.0.320.0170.02623.30
7.0.310.0250.02223.21
7.0.300.0070.03223.22
7.0.290.0180.02923.43
7.0.280.0130.02523.32
7.0.270.0200.01323.12
7.0.260.0270.02022.77
7.0.250.0200.01623.05
7.0.240.0170.02823.08
7.0.230.0190.02323.44
7.0.220.0250.01923.32
7.0.210.0130.02623.15
7.0.200.0110.02123.81
7.0.190.0140.02523.20
7.0.180.0160.01923.37
7.0.170.0190.01923.36
7.0.160.0130.02023.34
7.0.150.0110.02223.11
7.0.140.0080.06226.43
7.0.130.0200.03623.16
7.0.120.0200.02323.21
7.0.110.0180.01923.38
7.0.100.0200.05225.09
7.0.90.0170.04824.95
7.0.80.0180.05625.16
7.0.70.0210.05524.99
7.0.60.0180.04825.03
7.0.50.0280.06025.35
7.0.40.0270.06122.06
7.0.30.0130.06822.20
7.0.20.0270.06822.09
7.0.10.0190.05222.09
7.0.00.0230.05122.00
5.6.380.0160.06933.38
5.6.370.0170.06833.18
5.6.360.0190.06533.10
5.6.350.0130.06833.29
5.6.340.0270.05833.36
5.6.330.0070.07633.55
5.6.320.0250.06933.21
5.6.310.0240.07233.28
5.6.300.0240.06133.48
5.6.290.0100.07233.19
5.6.280.0200.09036.33
5.6.270.0100.08433.09
5.6.260.0170.06433.50
5.6.250.0150.09036.30
5.6.240.0150.07736.13
5.6.230.0200.07636.11
5.6.220.0220.08736.10
5.6.210.0200.09836.23
5.6.200.0180.10336.39
5.6.190.0230.10436.49
5.6.180.0250.10536.47
5.6.170.0200.08736.72
5.6.160.0130.10336.40
5.6.150.0120.07736.61
5.6.140.0150.08136.57
5.6.130.0250.08336.41
5.6.120.0120.08236.48
5.6.110.0180.11336.37
5.6.100.0190.07936.57
5.6.90.0120.08836.43
5.6.80.0150.09536.10
5.6.70.0190.06936.20
5.6.60.0200.07736.01
5.6.50.0200.07136.08
5.6.40.0080.09735.95
5.6.30.0080.09236.08
5.6.20.0210.08336.13
5.6.10.0150.09336.12
5.6.00.0100.08236.07
5.5.380.0200.10134.66
5.5.370.0070.08334.49
5.5.360.0130.09434.46
5.5.350.0170.09934.55
5.5.340.0160.09634.72
5.5.330.0180.10734.80
5.5.320.0170.08534.83
5.5.310.0130.09934.60
5.5.300.0210.09134.77
5.5.290.0170.08334.81
5.5.280.0120.09234.85
5.5.270.0170.07334.73
5.5.260.0170.09434.72
5.5.250.0220.09934.71
5.5.240.0200.09934.34
5.5.230.0230.08734.49
5.5.220.0200.09134.37
5.5.210.0150.10034.45
5.5.200.0130.07434.56
5.5.190.0100.09234.31
5.5.180.0170.10234.42
5.5.170.0160.08130.05
5.5.160.0210.08434.46
5.5.150.0070.09534.27
5.5.140.0190.06834.53
5.5.130.0240.09934.38
5.5.120.0190.10134.33
5.5.110.0170.08934.40
5.5.100.0220.09334.38
5.5.90.0190.09634.36
5.5.80.0180.07134.38
5.5.70.0120.08834.44
5.5.60.0170.09434.29
5.5.50.0130.10634.32
5.5.40.0210.08834.43
5.5.30.0100.10434.39
5.5.20.0170.06734.35
5.5.10.0130.10334.33
5.5.00.0170.08334.21
5.4.450.0180.10333.99
5.4.440.0150.07334.01
5.4.430.0130.08733.71
5.4.420.0050.09133.82
5.4.410.0150.08433.75
5.4.400.0190.07733.67
5.4.390.0120.09233.60
5.4.380.0130.08533.60
5.4.370.0180.08533.72
5.4.360.0200.06733.50
5.4.350.0120.08733.63
5.4.340.0180.08733.75
5.4.330.0130.07429.31
5.4.320.0180.08133.69
5.4.310.0190.07733.68
5.4.300.0100.08433.76
5.4.290.0080.08133.78
5.4.280.0100.07533.65
5.4.270.0130.09033.54
5.4.260.0200.08133.76
5.4.250.0150.07733.80
5.4.240.0120.08033.54
5.4.230.0170.09033.72
5.4.220.0180.09033.76
5.4.210.0190.07433.65
5.4.200.0130.09433.84
5.4.190.0150.09433.79
5.4.180.0140.07233.63
5.4.170.0190.09033.82
5.4.160.0080.07733.59
5.4.150.0180.08033.71
5.4.140.0230.07632.50
5.4.130.0160.07832.38
5.4.120.0150.07832.54
5.4.110.0150.07332.37
5.4.100.0100.10132.38
5.4.90.0120.09332.48
5.4.80.0180.07232.30
5.4.70.0150.07532.33
5.4.60.0170.06832.46
5.4.50.0150.06632.49
5.4.40.0160.07232.54
5.4.30.0200.08832.50
5.4.20.0080.07832.37
5.4.10.0220.06532.54
5.4.00.0080.08732.21
5.3.290.0020.03012.90
5.3.280.0050.04012.94
5.3.270.0050.04112.96
5.3.260.0050.02712.96
5.3.250.0050.02612.90
5.3.240.0070.03512.88
5.3.230.0060.02512.88
5.3.220.0060.03812.93
5.3.210.0070.03312.92
5.3.200.0060.04312.88
5.3.190.0050.04312.93
5.3.180.0030.02712.88
5.3.170.0050.02012.92
5.3.160.0120.01812.86
5.3.150.0030.03112.92
5.3.140.0050.04212.89
5.3.130.0050.03712.85
5.3.120.0030.04312.84
5.3.110.0070.02512.89
5.3.100.0020.04012.68
5.3.90.0070.01512.62
5.3.80.0040.01812.56
5.3.70.0040.02712.62
5.3.60.0070.02812.55
5.3.50.0000.02512.57
5.3.40.0050.03912.61
5.3.30.0030.02312.53
5.3.20.0050.04612.47
5.3.10.0050.02912.46
5.3.00.0050.01912.43
5.2.170.0070.03011.14
5.2.160.0030.02811.09
5.2.150.0040.02011.09
5.2.140.0070.03111.15
5.2.130.0030.01711.04
5.2.120.0090.02711.07
5.2.110.0050.02211.04
5.2.100.0030.02611.13
5.2.90.0030.01711.13
5.2.80.0040.02511.17
5.2.70.0000.02411.05
5.2.60.0110.01211.11
5.2.50.0030.03211.05
5.2.40.0070.01811.08
5.2.30.0050.02311.05
5.2.20.0030.02910.99
5.2.10.0070.02910.98
5.2.00.0020.02210.98
5.1.60.0040.02410.60
5.1.50.0040.02810.60
5.1.40.0030.02810.58
5.1.30.0000.01910.69
5.1.20.0050.03010.73
5.1.10.0020.01810.62
5.1.00.0060.02810.63
5.0.50.0000.02310.58
5.0.40.0020.02110.58
5.0.30.0060.02710.58
5.0.20.0050.00810.58
5.0.10.0030.01110.58
5.0.00.0030.01610.58
4.4.90.0030.01310.58
4.4.80.0000.01410.58
4.4.70.0030.01710.58
4.4.60.0020.01310.58
4.4.50.0010.01410.58
4.4.40.0040.01710.58
4.4.30.0020.01110.58
4.4.20.0020.02410.58
4.4.10.0040.01510.58
4.4.00.0040.02310.58
4.3.110.0070.01010.58
4.3.100.0030.01010.58
4.3.90.0020.01610.58
4.3.80.0020.01510.58
4.3.70.0020.01010.58
4.3.60.0020.01910.58
4.3.50.0020.01110.58
4.3.40.0030.02010.58
4.3.30.0010.01510.58
4.3.20.0020.01710.58
4.3.10.0020.00910.58
4.3.00.0000.02110.58

preferences:
36 ms | 401 KiB | 5 Q