3v4l.org

run code in 300+ PHP versions simultaneously
<?php // SETUP CODE class A { function __construct($val) { $this->val = $val; } } $objs = [ new A(3), new A(5), new A(2), ]; // AMAZING max_by IMPL :P $res = array_reduce($objs, function ($c, $o) { $c = max($o->val, $c->val); return $o->val == $c->val ? $o : $c; }, new A(0)); var_dump($res);

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)
8.3.60.0140.00716.75
8.3.50.0130.00622.98
8.3.40.0030.01218.75
8.3.30.0100.00318.86
8.3.20.0000.00820.51
8.3.10.0080.00020.61
8.3.00.0040.00419.02
8.2.180.0110.00418.55
8.2.170.0070.00722.96
8.2.160.0060.00920.45
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0040.00419.25
8.2.110.0030.00619.27
8.2.100.0120.00318.03
8.2.90.0030.00518.22
8.2.80.0040.00419.38
8.2.70.0030.00617.63
8.2.60.0000.00818.04
8.2.50.0030.00518.07
8.2.40.0040.00418.22
8.2.30.0000.00719.44
8.2.20.0040.00417.74
8.2.10.0040.00418.13
8.2.00.0070.00017.62
8.1.280.0110.00425.92
8.1.270.0030.00523.97
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.55
8.1.230.0000.01221.04
8.1.220.0030.00617.74
8.1.210.0040.00418.97
8.1.200.0000.00817.23
8.1.190.0000.00917.40
8.1.180.0050.00318.10
8.1.170.0090.00018.49
8.1.160.0000.00718.95
8.1.150.0040.00419.01
8.1.140.0000.00817.42
8.1.130.0000.00717.78
8.1.120.0000.00717.54
8.1.110.0080.00017.38
8.1.100.0030.00517.48
8.1.90.0020.00517.48
8.1.80.0000.00717.45
8.1.70.0030.00317.36
8.1.60.0000.00817.48
8.1.50.0000.00817.54
8.1.40.0030.00617.54
8.1.30.0080.00017.67
8.1.20.0000.00817.63
8.1.10.0050.00217.49
8.1.00.0070.00417.57
8.0.300.0040.00420.02
8.0.290.0040.00417.05
8.0.280.0000.00718.38
8.0.270.0030.00317.27
8.0.260.0040.00417.33
8.0.250.0030.00317.00
8.0.240.0000.00717.00
8.0.230.0030.00316.97
8.0.220.0070.00016.84
8.0.210.0000.00717.02
8.0.200.0060.00017.00
8.0.190.0040.00417.03
8.0.180.0080.00016.95
8.0.170.0040.00416.85
8.0.160.0000.00716.87
8.0.150.0000.00716.86
8.0.140.0050.00216.82
8.0.130.0050.00013.48
8.0.120.0080.00016.83
8.0.110.0050.00316.94
8.0.100.0000.00717.08
8.0.90.0030.00516.79
8.0.80.0100.01417.00
8.0.70.0060.00317.01
8.0.60.0030.00516.77
8.0.50.0000.00816.89
8.0.30.0070.01417.26
8.0.20.0110.01117.40
8.0.10.0040.00416.98
8.0.00.0070.01216.63
7.4.330.0020.00215.20
7.4.320.0000.00616.67
7.4.300.0040.00416.61
7.4.290.0050.00216.43
7.4.280.0050.00216.50
7.4.270.0030.00316.58
7.4.260.0040.00416.45
7.4.250.0040.00416.47
7.4.240.0020.00516.49
7.4.230.0000.00816.72
7.4.220.0100.01316.42
7.4.210.0030.01716.72
7.4.200.0030.00316.70
7.4.160.0120.00316.60
7.4.150.0110.01117.40
7.4.140.0070.01017.86
7.4.130.0040.01616.60
7.4.120.0150.00316.56
7.4.110.0170.00016.25
7.4.100.0070.01416.66
7.4.90.0090.00916.52
7.4.80.0120.00616.54
7.4.70.0070.01016.55
7.4.60.0070.01016.44
7.4.50.0060.00316.63
7.4.40.0100.00716.62
7.4.30.0120.00616.64
7.4.00.0110.00415.16
7.3.330.0030.00313.44
7.3.320.0000.00613.38
7.3.310.0000.00916.27
7.3.300.0000.00716.34
7.3.290.0070.00816.29
7.3.280.0110.00716.34
7.3.270.0130.01117.40
7.3.260.0110.00716.68
7.3.250.0090.00816.44
7.3.240.0120.00616.38
7.3.230.0130.00316.41
7.3.210.0110.00716.42
7.3.200.0110.00619.39
7.3.190.0090.01016.50
7.3.180.0090.00916.62
7.3.170.0070.01416.27
7.3.160.0090.00616.49
7.3.10.0090.00616.54
7.3.00.0100.00716.43
7.2.330.0050.01216.37
7.2.320.0080.00816.55
7.2.310.0130.00316.56
7.2.300.0130.00316.58
7.2.290.0070.01016.53
7.2.130.0070.01116.65
7.2.120.0070.01116.82
7.2.110.0070.00716.72
7.2.100.0140.00316.39
7.2.90.0070.00716.76
7.2.80.0070.01016.58
7.2.70.0140.01016.62
7.2.60.0140.00716.45
7.2.50.0110.00716.67
7.2.40.0280.00616.50
7.2.30.0060.00816.85
7.2.20.0100.00716.80
7.2.10.0130.00716.69
7.2.00.0050.01218.09
7.1.250.0000.01615.70
7.1.100.0040.00418.48
7.1.70.0090.00617.09
7.1.60.0070.01819.34
7.1.50.0130.01016.79
7.1.00.0100.07022.36
7.0.200.0040.00416.75
7.0.140.0070.02722.09
7.0.60.0100.07320.03
7.0.50.0130.07717.73
7.0.40.0030.04320.21
7.0.30.0330.06720.11
7.0.20.0330.06020.27
7.0.10.0130.08020.21
7.0.00.0030.05720.07
5.6.280.0070.06720.77
5.6.210.0130.08320.50
5.6.200.0070.05018.12
5.6.190.0070.04720.57
5.6.180.0230.03320.55
5.6.170.0330.08020.57
5.6.160.0100.03720.39
5.6.150.0100.07718.18
5.6.140.0070.05718.15
5.6.130.0030.05018.16
5.6.120.0100.08320.98
5.6.110.0130.06720.96
5.6.100.0070.07020.99
5.6.90.0030.06020.96
5.6.80.0130.06020.54
5.5.350.0030.08020.39
5.5.340.0070.04718.04
5.5.330.0100.08320.43
5.5.320.3230.04020.52
5.5.310.0200.04720.32
5.5.300.0070.08017.94
5.5.290.0030.05018.04
5.5.280.0030.05020.89
5.5.270.0070.05720.75
5.5.260.0000.09320.87
5.5.250.0130.06720.48
5.5.240.0130.06320.29
5.4.450.0730.03719.30
5.4.440.0830.05719.55
5.4.430.0730.06719.23
5.4.420.0200.04719.51
5.4.410.0100.05319.28
5.4.400.0070.05319.23
5.4.390.0030.07019.16
5.4.380.0170.05019.13
5.4.370.0130.04718.98
5.4.360.0130.06719.26
5.4.350.0060.03512.02
5.4.340.0070.03912.02
5.4.320.0140.05512.51
5.4.310.0120.04712.51
5.4.300.0090.04812.51
5.4.290.0080.03612.50
5.4.280.0050.03612.39
5.4.270.0030.04112.39
5.4.260.0050.04012.40
5.4.250.0110.03612.40
5.4.240.0050.03712.40
5.4.230.0070.03712.39
5.4.220.0100.03412.39
5.4.210.0050.04112.39
5.4.200.0060.04112.39
5.4.190.0080.03912.38
5.4.180.0060.04212.39
5.4.170.0120.04712.40
5.4.160.0090.03712.40
5.4.150.0070.03612.39
5.4.140.0090.03712.08
5.4.130.0080.03412.06
5.4.120.0080.03512.02
5.4.110.0120.03112.02
5.4.100.0050.03712.02
5.4.90.0090.03512.02
5.4.80.0090.03412.02
5.4.70.0090.03212.01
5.4.60.0110.03212.01
5.4.50.0050.03612.01
5.4.40.0070.03512.00
5.4.30.0060.03512.00
5.4.20.0050.03611.99
5.4.10.0060.03612.00
5.4.00.0060.04011.48
5.3.290.0080.04412.80
5.3.280.0100.03512.71
5.3.270.0080.04612.72
5.3.260.0070.04512.72
5.3.250.0090.04412.72
5.3.240.0090.04212.72
5.3.230.0110.03812.71
5.3.220.0130.04712.68
5.3.210.0090.04012.68
5.3.200.0060.04112.68
5.3.190.0090.04612.68
5.3.180.0040.03912.68
5.3.170.0080.04112.67
5.3.160.0070.04212.68
5.3.150.0040.04112.68
5.3.140.0070.04012.66
5.3.130.0060.04012.66
5.3.120.0080.04712.65
5.3.110.0070.03812.66
5.3.100.0060.03812.13
5.3.90.0060.03712.11
5.3.80.0070.03912.09
5.3.70.0040.04012.09
5.3.60.0040.03812.08
5.3.50.0090.03412.02
5.3.40.0080.04612.02
5.3.30.0040.03911.98
5.3.20.0030.04011.76
5.3.10.0110.03111.73
5.3.00.0070.04211.72
5.2.170.0120.0589.22
5.2.160.0030.0389.22
5.2.150.0070.0319.22
5.2.140.0070.0319.21
5.2.130.0080.0329.18
5.2.120.0050.0339.18
5.2.110.0030.0349.19
5.2.100.0050.0339.18
5.2.90.0030.0359.18
5.2.80.0090.0299.18
5.2.70.0040.0379.18
5.2.60.0080.0329.13
5.2.50.0090.0319.10
5.2.40.0080.0419.07
5.2.30.0060.0359.05
5.2.20.0090.0309.04
5.2.10.0060.0308.95
5.2.00.0080.0298.80
5.1.60.0040.0278.09
5.1.50.0030.0298.09
5.1.40.0110.0428.07
5.1.30.0050.0268.41
5.1.20.0060.0268.45
5.1.10.0030.0278.16
5.1.00.0040.0268.16
5.0.50.0030.0266.64
5.0.40.0050.0216.50
5.0.30.0060.0316.31
5.0.20.0030.0206.28
5.0.10.0030.0206.26
5.0.00.0020.0326.25
4.4.90.0020.0184.78
4.4.80.0050.0134.75
4.4.70.0020.0174.75
4.4.60.0030.0154.75
4.4.50.0050.0154.77
4.4.40.0020.0264.71
4.4.30.0030.0164.76
4.4.20.0040.0164.85
4.4.10.0020.0164.85
4.4.00.0030.0254.76
4.3.110.0040.0154.67
4.3.100.0020.0174.66
4.3.90.0040.0144.63
4.3.80.0040.0254.59
4.3.70.0080.0224.63
4.3.60.0040.0144.63
4.3.50.0040.0174.63
4.3.40.0050.0264.54
4.3.30.0030.0153.30
4.3.20.0010.0173.28
4.3.10.0010.0193.24
4.3.00.0130.02313.38

preferences:
49.25 ms | 401 KiB | 5 Q