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($object) { $this->property = $object; } } $obj = new A(); $test = new B($obj); 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.70.0110.00816.38
8.3.60.0150.00318.27
8.3.50.0090.01122.18
8.3.40.0150.00018.70
8.3.30.0090.00619.09
8.3.20.0040.00420.25
8.3.10.0040.00423.64
8.3.00.0000.00819.25
8.2.180.0140.00716.32
8.2.170.0040.01122.96
8.2.160.0070.00720.39
8.2.150.0000.00724.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0040.00422.18
8.2.110.0090.00622.13
8.2.100.0040.00818.03
8.2.90.0000.00819.22
8.2.80.0030.00617.97
8.2.70.0040.00417.63
8.2.60.0000.00817.93
8.2.50.0090.00018.07
8.2.40.0030.00618.09
8.2.30.0040.00418.16
8.2.20.0040.00417.56
8.2.10.0070.00018.05
8.2.00.0040.00417.61
8.1.280.0120.00325.92
8.1.270.0030.00523.91
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0060.00322.75
8.1.230.0110.00317.70
8.1.220.0030.00617.75
8.1.210.0040.00418.77
8.1.200.0050.00517.25
8.1.190.0060.00317.35
8.1.180.0060.00318.10
8.1.170.0090.00018.66
8.1.160.0030.00721.82
8.1.150.0040.00418.86
8.1.140.0040.00417.43
8.1.130.0030.00317.76
8.1.120.0030.00317.40
8.1.110.0000.00717.37
8.1.100.0000.00717.36
8.1.90.0000.00817.43
8.1.80.0000.00817.29
8.1.70.0030.00317.40
8.1.60.0000.00817.48
8.1.50.0000.00817.57
8.1.40.0040.00417.54
8.1.30.0000.00817.64
8.1.20.0070.00017.64
8.1.10.0000.00817.57
8.1.00.0070.00017.49
8.0.300.0030.00618.77
8.0.290.0000.00716.75
8.0.280.0050.00318.35
8.0.270.0080.00017.25
8.0.260.0030.00317.17
8.0.250.0030.00316.84
8.0.240.0050.00316.94
8.0.230.0070.00016.86
8.0.220.0000.00616.82
8.0.210.0030.00316.82
8.0.200.0070.00016.86
8.0.190.0040.00416.84
8.0.180.0040.00416.88
8.0.170.0060.00316.84
8.0.160.0030.00316.89
8.0.150.0070.00016.61
8.0.140.0000.00716.68
8.0.130.0030.00313.21
8.0.120.0000.00716.64
8.0.110.0030.00516.85
8.0.100.0030.00416.77
8.0.90.0000.00716.70
8.0.80.0090.00616.81
8.0.70.0040.00416.82
8.0.60.0030.00316.69
8.0.50.0030.00516.76
8.0.30.0110.00817.11
8.0.20.0090.01017.40
8.0.10.0050.00316.76
8.0.00.0070.01016.81
7.4.330.0000.00615.02
7.4.320.0020.00516.45
7.4.300.0070.00016.48
7.4.290.0070.00016.59
7.4.280.0000.00716.40
7.4.270.0060.00016.39
7.4.260.0000.00816.55
7.4.250.0040.00416.49
7.4.240.0030.00316.50
7.4.230.0000.00716.66
7.4.220.0100.01416.55
7.4.210.0030.01516.57
7.4.200.0000.00716.34
7.4.160.0040.01216.70
7.4.150.0140.00717.40
7.4.140.0100.00817.86
7.4.130.0080.00916.45
7.4.120.0090.00816.54
7.4.110.0120.00616.51
7.4.100.0100.01016.62
7.4.90.0070.01016.38
7.4.80.0120.00919.39
7.4.70.0160.00016.46
7.4.60.0110.01016.39
7.4.50.0030.00316.24
7.4.40.0120.00416.38
7.4.30.0070.01016.63
7.4.00.0080.00814.89
7.3.330.0000.00513.19
7.3.320.0050.00013.21
7.3.310.0070.00016.23
7.3.300.0000.00616.29
7.3.290.0050.01116.27
7.3.280.0080.01016.25
7.3.270.0080.00917.40
7.3.260.0100.01416.18
7.3.250.0090.00716.50
7.3.240.0140.00416.32
7.3.230.0120.01016.49
7.3.210.0160.00416.50
7.3.200.0110.01119.39
7.3.190.0130.00616.08
7.3.180.0100.00616.51
7.3.170.0080.00816.56
7.3.160.0130.00616.36
7.3.120.0060.01315.12
7.3.110.0040.01414.63
7.3.100.0070.00714.77
7.3.90.0070.00714.89
7.3.80.0000.01614.62
7.3.70.0030.00914.72
7.3.60.0030.01014.79
7.3.50.0060.01014.64
7.3.40.0140.00314.80
7.3.30.0160.00014.47
7.3.20.0060.00316.72
7.3.10.0030.01216.61
7.3.00.0090.00316.65
7.2.330.0100.00716.72
7.2.320.0030.01216.64
7.2.310.0130.00316.57
7.2.300.0030.01416.73
7.2.290.0190.00616.71
7.2.250.0170.00015.10
7.2.240.0030.01015.28
7.2.230.0040.01514.88
7.2.220.0060.00815.09
7.2.210.0120.00614.99
7.2.200.0060.00915.07
7.2.190.0060.01315.21
7.2.180.0090.00915.03
7.2.170.0120.00614.80
7.1.330.0110.00415.61
7.1.320.0060.00915.72
7.1.310.0060.00916.16
7.1.300.0070.01115.67
7.1.290.0000.01515.84
7.1.280.0130.00015.85
7.1.270.0110.00315.93
7.1.260.0070.00715.80
7.1.100.0030.00617.98
7.1.70.0040.00417.04
7.1.60.0140.01119.32
7.1.50.0140.01016.70
7.1.00.0070.07322.31
7.0.200.0000.00916.47
7.0.140.0070.07021.99
7.0.60.0170.07720.02
7.0.50.0030.06717.83
7.0.40.0030.04320.13
7.0.30.0170.05020.25
7.0.20.0200.06320.06
7.0.10.0070.04320.15
7.0.00.0130.07020.08
5.6.280.0070.07021.15
5.6.210.0030.07720.55
5.6.200.0030.09018.23
5.6.190.0070.04320.77
5.6.180.0200.03720.64
5.6.170.0230.05020.59
5.6.160.0100.03320.48
5.6.150.0100.08018.28
5.6.140.0070.08318.12
5.6.130.0130.05018.28
5.6.120.0100.04021.14
5.6.110.0070.08321.01
5.6.100.0130.07721.00
5.6.90.0100.07721.02
5.6.80.0100.06020.38
5.6.70.4270.04320.40
5.5.350.0370.07720.43
5.5.340.0130.04018.04
5.5.330.0030.04020.13
5.5.320.0300.04320.27
5.5.310.0200.06320.42
5.5.300.0070.08017.92
5.5.290.0130.07317.97
5.5.280.0130.03720.78
5.5.270.0070.05020.89
5.5.260.0130.07720.68
5.5.250.0130.08020.77
5.5.240.0430.07020.19
5.4.450.0630.06019.30
5.4.440.0930.06319.16
5.4.430.0930.05319.58
5.4.420.0830.04019.46
5.4.410.0770.05319.49
5.4.400.0730.06319.38
5.4.390.1030.06319.23
5.4.380.0800.05319.14
5.4.370.0970.04718.98
5.4.360.0870.06019.01
5.4.350.0670.05719.26
5.4.340.0050.03512.02
5.4.320.0080.04412.50
5.4.310.0100.03512.50
5.4.300.0050.03812.50
5.4.290.0110.03912.49
5.4.280.0070.03812.39
5.4.270.0040.04112.39
5.4.260.0070.03712.39
5.4.250.0050.04112.40
5.4.240.0050.03912.40
5.4.230.0070.03712.39
5.4.220.0080.03612.39
5.4.210.0070.03512.39
5.4.200.0070.03812.38
5.4.190.0040.03812.38
5.4.180.0070.04012.38
5.4.170.0070.03512.39
5.4.160.0050.03812.39
5.4.150.0090.03412.39
5.4.140.0060.04012.07
5.4.130.0050.04112.05
5.4.120.0050.04912.02
5.4.110.0070.03812.02
5.4.100.0100.03412.01
5.4.90.0080.03712.02
5.4.80.0100.05112.01
5.4.70.0080.04012.01
5.4.60.0100.03412.01
5.4.50.0070.03812.01
5.4.40.0100.03612.00
5.4.30.0040.04511.99
5.4.20.0080.03312.00
5.4.10.0060.03412.00
5.4.00.0050.03711.48
5.3.290.0080.04612.80
5.3.280.0030.04112.71
5.3.270.0060.03912.73
5.3.260.0060.03912.72
5.3.250.0120.03112.72
5.3.240.0060.03812.72
5.3.230.0040.03912.71
5.3.220.0080.03612.68
5.3.210.0050.04312.68
5.3.200.0130.05712.68
5.3.190.0120.03812.68
5.3.180.0110.04512.68
5.3.170.0090.04812.67
5.3.160.0100.04112.68
5.3.150.0060.03712.67
5.3.140.0080.03512.66
5.3.130.0090.03612.66
5.3.120.0080.03612.66
5.3.110.0100.04712.66
5.3.100.0090.04412.12
5.3.90.0110.03112.11
5.3.80.0040.03812.10
5.3.70.0060.03612.09
5.3.60.0050.03712.08
5.3.50.0060.03612.03
5.3.40.0060.03712.03
5.3.30.0070.03311.98
5.3.20.0060.03711.77
5.3.10.0040.03611.73
5.3.00.0070.04411.72
5.2.170.0070.0419.23
5.2.160.0080.0289.23
5.2.150.0060.0299.23
5.2.140.0070.0289.22
5.2.130.0040.0309.18
5.2.120.0020.0319.18
5.2.110.0030.0319.19
5.2.100.0030.0309.19
5.2.90.0010.0329.18
5.2.80.0060.0299.17
5.2.70.0040.0319.18
5.2.60.0060.0299.13
5.2.50.0030.0329.10
5.2.40.0030.0309.07
5.2.30.0040.0309.05
5.2.20.0050.0289.04
5.2.10.0070.0268.95
5.2.00.0040.0308.81
5.1.60.0030.0258.09
5.1.50.0070.0318.09
5.1.40.0040.0258.07
5.1.30.0040.0268.41
5.1.20.0030.0278.44
5.1.10.0050.0248.17
5.1.00.0040.0258.17
5.0.50.0040.0206.64
5.0.40.0030.0196.50
5.0.30.0030.0316.32
5.0.20.0030.0196.28
5.0.10.0020.0286.26
5.0.00.0030.0416.25
4.4.90.0040.0214.78
4.4.80.0050.0194.75
4.4.70.0040.0154.76
4.4.60.0030.0154.75
4.4.50.0040.0134.77
4.4.40.0010.0264.71
4.4.30.0020.0194.76
4.4.20.0030.0224.85
4.4.10.0020.0204.85
4.4.00.0030.0294.76
4.3.110.0010.0174.67
4.3.100.0020.0154.67
4.3.90.0040.0134.63
4.3.80.0030.0244.59
4.3.70.0030.0144.63
4.3.60.0040.0144.63
4.3.50.0020.0174.63
4.3.40.0040.0234.54
4.3.30.0030.0173.30
4.3.20.0020.0173.28
4.3.10.0000.0173.23
4.3.00.0130.0176.83

preferences:
46.26 ms | 401 KiB | 5 Q