3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ public function sum($num1, $num2){ return $num1 + $num2; } } class B { public $property; public function __construct( A $object=null) { $property = $object; } } $test = new B(); echo $test->$property->sum(1,2); // output 3

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.0070.01018.68
8.3.50.0110.00417.95
8.3.40.0100.01018.96
8.3.30.0040.01119.06
8.3.20.0080.00020.34
8.3.10.0080.00023.65
8.3.00.0060.00319.26
8.2.180.0120.00616.88
8.2.170.0120.00322.96
8.2.160.0040.01120.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0070.00022.18
8.2.110.0030.00620.51
8.2.100.0040.00817.91
8.2.90.0000.00917.93
8.2.80.0000.00817.97
8.2.70.0050.00317.93
8.2.60.0000.00917.80
8.2.50.0090.00018.10
8.2.40.0000.00820.43
8.2.30.0040.00418.04
8.2.20.0080.00017.75
8.2.10.0020.00517.98
8.2.00.0030.00517.74
8.1.280.0070.00725.92
8.1.270.0040.00423.81
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00924.02
8.1.230.0030.00719.02
8.1.220.0050.00317.76
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0040.00417.13
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0070.00422.02
8.1.150.0070.00018.95
8.1.140.0040.00417.35
8.1.130.0000.00717.78
8.1.120.0000.00817.39
8.1.110.0000.00717.48
8.1.100.0070.00017.47
8.1.90.0000.00717.49
8.1.80.0000.00717.36
8.1.70.0000.00717.33
8.1.60.0000.00817.46
8.1.50.0050.00317.46
8.1.40.0040.00417.49
8.1.30.0040.00417.54
8.1.20.0000.00717.53
8.1.10.0050.00317.61
8.1.00.0060.00317.46
8.0.300.0000.00921.46
8.0.290.0040.00416.75
8.0.280.0040.00418.44
8.0.270.0000.00717.18
8.0.260.0030.00317.20
8.0.250.0050.00217.02
8.0.240.0000.00917.00
8.0.230.0030.00317.01
8.0.220.0070.00016.92
8.0.210.0000.00716.93
8.0.200.0030.00317.03
8.0.190.0040.00416.99
8.0.180.0000.00716.98
8.0.170.0030.00516.91
8.0.160.0070.00016.91
8.0.150.0060.00316.86
8.0.140.0000.00716.89
8.0.130.0000.00513.34
8.0.120.0050.00316.91
8.0.110.0080.00016.87
8.0.100.0040.00416.78
8.0.90.0040.00416.80
8.0.80.0030.01316.96
8.0.70.0070.00016.98
8.0.60.0000.00716.81
8.0.50.0030.00516.80
8.0.30.0120.00916.98
8.0.20.0120.00717.40
8.0.10.0000.00717.09
8.0.00.0100.01016.70
7.4.330.0030.00315.16
7.4.320.0000.00616.53
7.4.300.0040.00416.59
7.4.290.0070.00016.51
7.4.280.0050.00916.55
7.4.270.0070.00016.57
7.4.260.0000.00716.48
7.4.250.0040.00416.34
7.4.240.0040.00416.54
7.4.230.0040.00416.47
7.4.220.0090.00816.54
7.4.210.0070.00716.64
7.4.200.0000.00716.60
7.4.160.0090.00616.61
7.4.150.0150.00817.40
7.4.140.0060.01317.86
7.4.130.0090.00816.54
7.4.120.0030.01816.47
7.4.110.0110.00716.54
7.4.100.0170.00316.68
7.4.90.0100.00716.49
7.4.80.0100.01319.39
7.4.70.0130.00716.52
7.4.60.0120.00916.51
7.4.50.0000.00816.53
7.4.40.0100.00716.62
7.4.30.0060.01516.60
7.4.00.0000.01214.95
7.3.330.0060.00013.36
7.3.320.0020.00213.25
7.3.310.0070.00016.43
7.3.300.0040.00416.36
7.3.290.0100.00716.38
7.3.280.0100.00716.43
7.3.270.0030.01417.40
7.3.260.0150.00616.34
7.3.250.0090.01016.27
7.3.240.0070.01516.31
7.3.230.0140.00816.39
7.3.210.0140.00316.41
7.3.200.0090.00619.39
7.3.190.0100.02016.45
7.3.180.0090.00616.29
7.3.170.0100.00616.55
7.3.160.0070.01016.29
7.2.330.0060.01316.48
7.2.320.0090.00916.32
7.2.310.0150.00316.52
7.2.300.0000.01716.57
7.2.290.0150.00616.45
7.2.80.0000.00716.52
7.2.60.0040.00916.91
7.2.00.0080.00819.41
7.1.200.0040.00815.58
7.1.100.0070.00718.08
7.1.70.0030.00617.17
7.1.60.0100.01019.32
7.1.50.0160.00616.89
7.1.00.0000.08022.36
7.0.200.0070.00016.49
7.0.140.0030.07322.07
7.0.60.0130.05019.87
7.0.50.0030.08717.73
7.0.40.0100.03720.10
7.0.30.0470.04720.16
7.0.20.0370.05020.06
7.0.10.0070.05320.23
7.0.00.0030.08720.06
5.6.280.0100.06721.07
5.6.210.0100.07720.45
5.6.200.0100.03718.20
5.6.190.0000.04720.48
5.6.180.0170.04720.64
5.6.170.0270.07720.56
5.6.160.0030.04020.75
5.6.150.0030.05318.18
5.6.140.0070.04718.17
5.6.130.0130.04018.22
5.6.120.0100.08321.05
5.6.110.0070.08721.01
5.6.100.0230.06721.14
5.6.90.0070.04021.07
5.6.80.0130.07020.29
5.6.70.4230.04020.48
5.5.350.0370.06320.41
5.5.340.0070.07317.94
5.5.330.0070.05320.47
5.5.320.0370.07320.47
5.5.310.0370.06720.24
5.5.300.0100.05018.09
5.5.290.0100.04318.03
5.5.280.0100.08020.68
5.5.270.0030.05720.96
5.5.260.0170.07320.79
5.5.250.0100.06320.59
5.5.240.0500.06020.13
5.4.450.0530.05719.59
5.4.440.0870.05319.61
5.4.430.0130.05319.34
5.4.420.0770.05319.38
5.4.410.0400.04719.06
5.4.400.0570.04719.15
5.4.390.0630.06019.12
5.4.380.0630.05719.28
5.4.370.0530.05319.26
5.4.360.0770.05719.23
5.4.350.0800.04719.15
5.4.340.0070.04012.02
5.4.320.0060.03712.50
5.4.310.0040.03912.50
5.4.300.0090.04612.50
5.4.290.0100.04212.50
5.4.280.0060.03712.39
5.4.270.0040.03712.39
5.4.260.0050.03712.39
5.4.250.0040.03812.39
5.4.240.0070.03812.40
5.4.230.0050.03912.39
5.4.220.0040.04012.38
5.4.210.0090.03712.39
5.4.200.0070.04112.38
5.4.190.0050.03712.38
5.4.180.0030.03912.39
5.4.170.0080.03512.40
5.4.160.0060.04312.39
5.4.150.0060.04112.38
5.4.140.0090.05012.07
5.4.130.0070.03712.06
5.4.120.0090.03812.02
5.4.110.0080.04212.01
5.4.100.0170.03512.01
5.4.90.0030.03812.01
5.4.80.0040.04012.01
5.4.70.0080.03812.01
5.4.60.0070.03712.00
5.4.50.0060.03412.01
5.4.40.0070.03312.00
5.4.30.0040.03711.99
5.4.20.0040.03511.99
5.4.10.0050.03612.00
5.4.00.0070.03411.48
5.3.290.0070.03912.80
5.3.280.0070.03912.71
5.3.270.0040.04112.73
5.3.260.0080.03812.72
5.3.250.0100.04012.72
5.3.240.0060.03812.72
5.3.230.0040.03912.71
5.3.220.0050.03712.68
5.3.210.0030.04112.68
5.3.200.0050.03712.68
5.3.190.0050.03912.68
5.3.180.0050.03912.67
5.3.170.0070.03512.67
5.3.160.0030.03812.67
5.3.150.0030.04012.67
5.3.140.0050.04312.66
5.3.130.0090.04812.66
5.3.120.0070.05212.65
5.3.110.0070.04212.66
5.3.100.0070.03812.12
5.3.90.0050.03612.11
5.3.80.0060.03612.10
5.3.70.0100.03612.10
5.3.60.0100.04712.09
5.3.50.0100.04612.03
5.3.40.0080.03712.03
5.3.30.0100.03611.98
5.3.20.0040.04011.77
5.3.10.0050.04311.73
5.3.00.0070.04011.73
5.2.170.0050.0329.23
5.2.160.0110.0429.23
5.2.150.0090.0409.23
5.2.140.0080.0419.23
5.2.130.0040.0339.19
5.2.120.0040.0299.19
5.2.110.0050.0349.19
5.2.100.0060.0319.19
5.2.90.0070.0409.18
5.2.80.0060.0299.18
5.2.70.0050.0309.18
5.2.60.0040.0309.13
5.2.50.0050.0339.11
5.2.40.0060.0429.08
5.2.30.0100.0409.05
5.2.20.0060.0369.04
5.2.10.0070.0378.95
5.2.00.0060.0308.81
5.1.60.0080.0288.09
5.1.50.0040.0258.09
5.1.40.0070.0318.08
5.1.30.0070.0238.42
5.1.20.0060.0278.44
5.1.10.0030.0278.17
5.1.00.0030.0278.17
5.0.50.0070.0176.65
5.0.40.0060.0246.50
5.0.30.0060.0296.32
5.0.20.0040.0196.29
5.0.10.0050.0186.26
5.0.00.0020.0336.26
4.4.90.0030.0164.78
4.4.80.0020.0164.76
4.4.70.0020.0164.76
4.4.60.0020.0174.76
4.4.50.0050.0184.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0030.0154.84
4.4.10.0020.0164.85
4.4.00.0030.0254.76
4.3.110.0030.0164.67
4.3.100.0050.0194.67
4.3.90.0010.0164.63
4.3.80.0050.0304.59
4.3.70.0060.0184.63
4.3.60.0030.0144.63
4.3.50.0010.0184.63
4.3.40.0030.0254.54
4.3.30.0030.0153.30
4.3.20.0030.0163.28
4.3.10.0000.0183.23
4.3.00.0200.0237.25

preferences:
42.49 ms | 400 KiB | 5 Q