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), new A(8), new A(1), ]; // AMAZING max_by IMPL :P $res = array_reduce($objs, function ($c, $o) { $p = !is_null($c) ? $c->val : 0; $c = max($o->val, $p); return $o->val == $p ? $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.0150.00316.63
8.3.50.0070.01522.91
8.3.40.0110.00419.08
8.3.30.0110.00319.04
8.3.20.0040.00420.30
8.3.10.0050.00320.48
8.3.00.0040.00419.00
8.2.180.0070.01318.66
8.2.170.0130.00322.96
8.2.160.0090.00920.28
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.01026.16
8.2.120.0040.01319.16
8.2.110.0060.00322.26
8.2.100.0040.00817.91
8.2.90.0000.00819.26
8.2.80.0070.00019.41
8.2.70.0030.00717.63
8.2.60.0000.00817.92
8.2.50.0090.00018.07
8.2.40.0050.00318.28
8.2.30.0000.00821.28
8.2.20.0000.00817.88
8.2.10.0040.00417.99
8.2.00.0030.00517.78
8.1.280.0100.00725.92
8.1.270.0040.00423.75
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0030.00722.50
8.1.230.0040.00720.91
8.1.220.0040.00418.77
8.1.210.0040.00419.03
8.1.200.0030.00617.35
8.1.190.0080.00017.53
8.1.180.0040.00418.10
8.1.170.0000.00818.57
8.1.160.0040.00418.92
8.1.150.0070.00018.91
8.1.140.0040.00417.50
8.1.130.0030.00317.75
8.1.120.0000.00717.55
8.1.110.0080.00017.41
8.1.100.0040.00417.48
8.1.90.0050.00317.45
8.1.80.0000.00817.49
8.1.70.0070.00017.45
8.1.60.0000.00817.57
8.1.50.0000.00917.57
8.1.40.0080.00017.54
8.1.30.0080.00017.72
8.1.20.0000.00817.70
8.1.10.0000.00817.56
8.1.00.0040.00417.52
8.0.300.0060.00320.03
8.0.290.0000.00717.17
8.0.280.0000.00718.42
8.0.270.0000.00717.20
8.0.260.0040.00418.96
8.0.250.0000.00717.00
8.0.240.0050.00316.89
8.0.230.0070.00017.01
8.0.220.0090.00016.95
8.0.210.0030.00517.00
8.0.200.0000.00717.02
8.0.190.0070.00017.04
8.0.180.0070.00016.86
8.0.170.0040.00416.90
8.0.160.0080.00017.07
8.0.150.0040.00416.91
8.0.140.0030.00516.95
8.0.130.0000.00513.38
8.0.120.0050.00316.95
8.0.110.0030.00516.90
8.0.100.0040.00417.02
8.0.90.0060.00316.89
8.0.80.0030.01917.01
8.0.70.0000.00817.04
8.0.60.0040.00416.97
8.0.50.0040.00416.89
8.0.30.0070.01217.11
8.0.20.0090.00917.40
8.0.10.0030.00516.89
8.0.00.0100.00816.77
7.4.330.0050.00015.02
7.4.320.0030.00316.52
7.4.300.0000.00616.53
7.4.290.0080.00016.63
7.4.280.0030.00616.63
7.4.270.0030.00316.55
7.4.260.0000.00816.38
7.4.250.0040.00416.61
7.4.240.0000.00716.54
7.4.230.0030.00316.37
7.4.220.0100.00616.56
7.4.210.0070.01316.61
7.4.200.0070.00016.65
7.4.160.0130.00316.34
7.4.150.0070.01117.40
7.4.140.0150.00517.86
7.4.130.0150.00616.58
7.4.120.0100.00716.55
7.4.110.0090.00916.66
7.4.100.0080.00816.52
7.4.90.0200.00016.67
7.4.80.0150.00616.61
7.4.70.0060.00916.48
7.4.60.0100.00616.63
7.4.50.0040.00416.57
7.4.40.0130.00316.43
7.4.30.0070.01416.54
7.4.00.0090.00614.91
7.3.330.0030.00313.39
7.3.320.0000.00513.45
7.3.310.0000.00716.24
7.3.300.0000.00716.29
7.3.290.0100.00416.32
7.3.280.0090.00816.36
7.3.270.0100.00717.40
7.3.260.0090.00916.39
7.3.250.0090.01116.58
7.3.240.0090.00816.33
7.3.230.0100.00616.61
7.3.210.0130.00416.61
7.3.200.0080.01019.39
7.3.190.0170.00316.27
7.3.180.0030.01516.30
7.3.170.0150.00616.40
7.3.160.0030.01316.62
7.3.10.0080.00516.62
7.3.00.0060.00716.68
7.2.330.0060.01216.80
7.2.320.0110.01716.77
7.2.310.0030.01316.56
7.2.300.0070.01116.60
7.2.290.0100.00716.89
7.2.130.0130.00316.93
7.2.120.0050.00916.86
7.2.110.0100.00916.86
7.2.100.0070.00416.86
7.2.90.0120.00716.85
7.2.80.0070.00917.04
7.2.70.0050.00916.97
7.2.60.0060.00617.04
7.2.50.0030.00817.12
7.2.40.0040.00816.81
7.2.30.0020.01017.03
7.2.20.0070.00817.00
7.2.10.0030.00816.82
7.2.00.0020.01417.81
7.1.250.0000.00915.78
7.1.240.0060.00616.02
7.1.230.0030.01315.80
7.1.220.0040.01115.83
7.1.210.0090.00315.89
7.1.200.0030.00715.74
7.1.190.0110.00315.55
7.1.180.0070.01015.52
7.1.170.0100.00015.59
7.1.160.0070.00715.98
7.1.150.0030.01215.83
7.1.140.0070.00715.72
7.1.130.0030.00915.78
7.1.120.0100.00715.91
7.1.110.0040.00415.82
7.1.100.0030.00816.98
7.1.90.0000.01215.90
7.1.80.0060.00615.99
7.1.70.0030.00816.50
7.1.60.0090.01017.61
7.1.50.0110.00716.25
7.1.40.0070.00715.77
7.1.30.0080.00515.89
7.1.20.0070.00715.80
7.1.10.0090.00315.87
7.1.00.0080.04018.94
7.0.330.0140.00015.46
7.0.320.0040.00715.34
7.0.310.0000.01015.23
7.0.300.0030.01015.33
7.0.290.0000.01115.00
7.0.280.0040.00715.41
7.0.270.0100.00015.09
7.0.260.0090.00315.26
7.0.250.0100.00315.36
7.0.240.0130.00615.29
7.0.230.0030.00515.29
7.0.220.0120.00615.41
7.0.210.0030.00615.39
7.0.200.0060.00315.94
7.0.190.0030.01315.16
7.0.180.0170.00015.29
7.0.170.0030.01015.27
7.0.160.0030.01315.05
7.0.150.0000.01215.21
7.0.140.0020.02218.69
7.0.130.0030.01015.27
7.0.120.0040.00915.18
7.0.110.0070.00315.45
7.0.100.0040.01215.31
7.0.90.0130.00315.41
7.0.80.0130.00315.27
7.0.70.0090.00615.27
7.0.60.0070.03317.59
7.0.50.0060.03816.65
7.0.40.0090.02316.92
7.0.30.0270.03916.88
7.0.20.0150.02916.74
7.0.10.0090.02316.74
7.0.00.0030.04016.71
5.6.380.0030.01014.23
5.6.370.0030.01014.42
5.6.360.0030.01314.18
5.6.350.0030.01314.23
5.6.340.0040.00813.94
5.6.330.0000.01213.91
5.6.320.0040.00414.31
5.6.310.0060.00314.07
5.6.300.0040.01213.85
5.6.290.0030.00814.32
5.6.280.0130.03317.63
5.6.270.0140.00014.49
5.6.260.0030.00614.41
5.6.250.0090.00414.50
5.6.240.0070.00714.43
5.6.230.0000.01614.32
5.6.220.0070.00714.51
5.6.210.0020.04017.42
5.6.200.0030.02816.21
5.6.190.0050.02717.36
5.6.180.0000.05317.41
5.6.170.0220.03517.30
5.6.160.0040.03617.31
5.6.150.0120.03216.10
5.6.140.0060.03016.35
5.6.130.0090.03116.10
5.6.120.0080.04417.73
5.6.110.0090.03617.75
5.6.100.0050.04317.63
5.6.90.0070.04317.74
5.6.80.0030.02517.46
5.6.70.0030.00614.36
5.6.60.0030.01314.11
5.6.50.0090.00614.05
5.6.40.0040.00814.24
5.6.30.0030.01013.89
5.6.20.0070.00714.52
5.6.10.0070.00714.18
5.6.00.0060.00614.12
5.5.380.0030.00711.25
5.5.370.0030.00611.26
5.5.360.0040.00711.02
5.5.350.0080.03115.79
5.5.340.0070.02014.57
5.5.330.0100.03815.68
5.5.320.0050.02815.64
5.5.310.0180.04215.68
5.5.300.0040.03914.53
5.5.290.0120.02214.43
5.5.280.0070.04515.86
5.5.270.0090.04115.96
5.5.260.0050.03516.13
5.5.250.0100.04315.88
5.5.240.0650.02715.51
5.5.230.0110.00010.96
5.5.220.0040.00410.93
5.5.210.0060.00911.27
5.5.200.0030.01010.92
5.5.190.0070.00411.17
5.5.180.0100.00311.13
5.5.170.0090.00310.87
5.5.160.0000.01011.17
5.5.150.0090.00411.08
5.5.140.0070.00311.09
5.5.130.0060.00611.31
5.5.120.0040.00410.95
5.5.110.0000.00611.05
5.5.100.0040.00810.97
5.5.90.0060.00610.88
5.5.80.0110.00011.14
5.5.70.0030.00811.00
5.5.60.0090.00311.24
5.5.50.0030.00311.17
5.5.40.0140.00011.14
5.5.30.0070.00311.18
5.5.20.0030.00611.08
5.5.10.0000.01211.17
5.5.00.0070.00710.69
5.4.450.0100.02715.31
5.4.440.0540.01915.33
5.4.430.0140.02415.36
5.4.420.0080.03015.23
5.4.410.0070.03015.03
5.4.400.0050.03115.01
5.4.390.0050.03315.02
5.4.380.0070.03214.92
5.4.370.0080.02915.12
5.4.360.0120.02515.05
5.4.350.0070.01911.52
5.4.340.0040.02011.53
5.4.330.0000.01010.71
5.4.320.0050.02211.79
5.4.310.0070.02211.76
5.4.300.0070.02111.76
5.4.290.0070.02111.74
5.4.280.0040.02211.70
5.4.270.0080.01911.56
5.4.260.0060.02111.53
5.4.250.0060.02311.65
5.4.240.0060.02111.64
5.4.230.0040.03011.76
5.4.220.0070.02211.78
5.4.210.0050.02011.68
5.4.200.0070.02111.71
5.4.190.0070.01911.71
5.4.180.0070.02211.65
5.4.170.0060.02311.60
5.4.160.0060.02011.63
5.4.150.0070.02011.54
5.4.140.0060.02211.60
5.4.130.0050.02111.57
5.4.120.0040.02711.46
5.4.110.0040.02911.54
5.4.100.0100.02411.51
5.4.90.0060.02911.51
5.4.80.0070.02311.49
5.4.70.0020.02411.46
5.4.60.0080.01911.60
5.4.50.0050.02311.56
5.4.40.0070.02711.59
5.4.30.0070.02111.39
5.4.20.0060.02311.58
5.4.10.0080.02511.47
5.4.00.0080.02111.20
5.3.290.0070.02511.46
5.3.280.0040.02711.50
5.3.270.0100.02511.42
5.3.260.0080.02011.49
5.3.250.0070.01911.42
5.3.240.0050.02611.45
5.3.230.0040.02511.36
5.3.220.0100.02111.34
5.3.210.0060.02711.34
5.3.200.0070.02211.48
5.3.190.0040.02511.46
5.3.180.0040.02211.40
5.3.170.0050.02111.57
5.3.160.0030.02311.55
5.3.150.0060.02411.46
5.3.140.0040.02311.53
5.3.130.0090.02311.39
5.3.120.0060.02211.42
5.3.110.0020.02711.39
5.3.100.0050.03211.10
5.3.90.0070.02211.28
5.3.80.0050.02111.08
5.3.70.0100.01911.07
5.3.60.0040.02311.19
5.3.50.0040.02111.18
5.3.40.0030.02411.12
5.3.30.0080.03611.11
5.3.20.0060.02110.99
5.3.10.0100.02910.81
5.3.00.0070.02410.91
5.2.170.0060.0239.21
5.2.160.0070.0189.31
5.2.150.0080.0219.15
5.2.140.0040.0209.15
5.2.130.0040.0289.16
5.2.120.0040.0179.18
5.2.110.0060.0189.25
5.2.100.0090.0159.25
5.2.90.0060.0179.25
5.2.80.0040.0209.19
5.2.70.0060.0179.27
5.2.60.0040.0199.14
5.2.50.0070.0199.05
5.2.40.0040.0199.20
5.2.30.0030.0179.07
5.2.20.0070.0169.13
5.2.10.0070.0238.97
5.2.00.0060.0238.91
5.1.60.0090.0268.22
5.1.50.0040.0198.20
5.1.40.0040.0248.19
5.1.30.0030.0178.47
5.1.20.0020.0178.48
5.1.10.0120.0348.27
5.1.00.0050.0178.24
5.0.50.0030.0157.48
5.0.40.0050.0147.41
5.0.30.0030.0177.32
5.0.20.0010.0147.30
5.0.10.0040.0117.29
5.0.00.0030.0177.29
4.4.90.0050.0076.55
4.4.80.0020.0116.54
4.4.70.0020.0136.54
4.4.60.0020.0106.54
4.4.50.0020.0116.54
4.4.40.0020.0176.51
4.4.30.0040.0126.54
4.4.20.0020.0166.58
4.4.10.0030.0106.58
4.4.00.0020.0176.54
4.3.110.0010.0126.49
4.3.100.0020.0106.49
4.3.90.0020.0116.47
4.3.80.0030.0146.45
4.3.70.0040.0086.47
4.3.60.0030.0096.47
4.3.50.0030.0106.47
4.3.40.0020.0166.43
4.3.30.0010.0115.81
4.3.20.0010.0115.79
4.3.10.0040.0095.78
4.3.00.0150.01010.85

preferences:
36.77 ms | 401 KiB | 5 Q