3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Ancestor { protected $val = 'ancestor'; } class Child1 extends Ancestor { function __construct() { $this->val = 'child1'; } } class Child2 extends Ancestor { function output(Ancestor $subject) { echo $subject->val, "\n"; } } $child1 = new Child1(); $child2 = new Child2(); $child2->output($child1); // Output: child1

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.0100.00718.43
8.3.50.0100.00822.74
8.3.40.0140.00018.57
8.3.30.0170.00319.08
8.3.20.0080.00020.35
8.3.10.0040.00420.34
8.3.00.0080.00019.14
8.2.180.0040.01516.38
8.2.170.0070.00722.96
8.2.160.0080.00821.95
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00926.16
8.2.120.0030.00621.03
8.2.110.0030.00621.04
8.2.100.0040.00817.84
8.2.90.0000.00819.17
8.2.80.0000.00817.97
8.2.70.0000.00817.63
8.2.60.0000.00817.93
8.2.50.0000.00818.10
8.2.40.0000.00718.16
8.2.30.0000.00719.43
8.2.20.0080.00017.68
8.2.10.0030.00618.04
8.2.00.0000.00817.67
8.1.280.0140.00025.92
8.1.270.0080.00021.98
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.74
8.1.230.0140.00017.49
8.1.220.0000.00817.78
8.1.210.0030.00618.77
8.1.200.0000.00817.23
8.1.190.0040.00417.00
8.1.180.0080.00018.10
8.1.170.0000.00818.41
8.1.160.0070.00021.87
8.1.150.0060.00318.73
8.1.140.0050.00217.38
8.1.130.0050.00317.73
8.1.120.0000.00717.29
8.1.110.0040.00417.39
8.1.100.0030.00317.45
8.1.90.0030.00317.38
8.1.80.0040.00417.23
8.1.70.0070.00017.36
8.1.60.0050.00317.51
8.1.50.0030.00617.52
8.1.40.0050.00217.48
8.1.30.0040.00417.58
8.1.20.0030.00517.71
8.1.10.0040.00417.56
8.1.00.0040.00417.40
8.0.300.0030.00618.77
8.0.290.0000.00816.75
8.0.280.0030.00318.36
8.0.270.0070.00017.25
8.0.260.0000.00717.25
8.0.250.0070.00017.01
8.0.240.0000.00817.07
8.0.230.0000.00716.94
8.0.220.0060.00016.82
8.0.210.0000.00716.80
8.0.200.0070.00016.96
8.0.190.0050.00316.96
8.0.180.0070.00016.91
8.0.170.0040.00416.89
8.0.160.0000.00716.71
8.0.150.0070.00016.82
8.0.140.0000.00916.79
8.0.130.0000.00613.41
8.0.120.0030.00616.89
8.0.110.0000.00716.90
8.0.100.0070.00017.00
8.0.90.0000.00716.96
8.0.80.0070.01416.88
8.0.70.0040.00416.68
8.0.60.0070.00016.88
8.0.50.0040.00416.72
8.0.30.0130.00617.16
8.0.20.0150.00817.40
8.0.10.0050.00216.96
8.0.00.0100.00916.67
7.4.330.0000.00515.03
7.4.320.0030.00316.41
7.4.300.0000.00616.60
7.4.290.0030.00316.61
7.4.280.0000.00716.44
7.4.270.0070.00016.50
7.4.260.0050.00216.63
7.4.250.0050.00316.48
7.4.240.0020.00616.48
7.4.230.0000.00716.70
7.4.220.0190.00616.66
7.4.210.0040.01116.68
7.4.200.0030.00316.63
7.4.160.0030.01316.54
7.4.150.0120.00617.40
7.4.140.0100.01117.86
7.4.130.0060.01016.49
7.4.120.0110.00716.47
7.4.110.0090.00616.50
7.4.100.0100.00716.49
7.4.90.0070.01016.40
7.4.80.0070.01419.39
7.4.70.0070.01016.30
7.4.60.0070.01016.18
7.4.50.0000.00716.22
7.4.40.0120.00616.39
7.4.30.0060.01016.50
7.4.00.0130.00314.98
7.3.330.0030.00313.36
7.3.320.0000.00713.11
7.3.310.0000.00716.34
7.3.300.0000.00616.29
7.3.290.0030.01616.32
7.3.280.0110.00716.30
7.3.270.0140.00317.40
7.3.260.0090.01416.52
7.3.250.0130.00616.37
7.3.240.0070.01016.50
7.3.230.0070.01316.39
7.3.210.0080.01416.14
7.3.200.0130.00719.39
7.3.190.0060.01316.38
7.3.180.0070.01016.45
7.3.170.0100.01316.27
7.3.160.0160.00016.49
7.3.10.0060.00616.55
7.3.00.0030.01016.69
7.2.330.0120.00616.60
7.2.320.0060.01016.72
7.2.310.0030.02116.81
7.2.300.0090.00816.83
7.2.290.0060.01316.78
7.2.130.0040.01116.74
7.2.120.0120.00316.74
7.2.110.0040.01216.95
7.2.100.0000.00916.80
7.2.90.0000.01517.10
7.2.80.0060.00816.78
7.2.70.0040.01116.75
7.2.60.0050.00917.09
7.2.50.0090.00617.14
7.2.40.0050.00516.86
7.2.30.0030.01016.80
7.2.20.0060.01217.03
7.2.10.0030.01216.64
7.2.00.0130.00718.21
7.1.250.0060.00315.75
7.1.200.0050.00515.87
7.1.100.0110.00318.03
7.1.70.0000.00716.90
7.1.60.0100.01419.61
7.1.50.0100.01316.86
7.1.00.0100.07022.36
7.0.200.0220.00415.02
7.0.140.0070.07022.18
7.0.60.0030.06019.85
7.0.50.0030.08017.88
7.0.40.0300.06320.52
7.0.30.0130.05020.26
7.0.20.0300.06320.06
7.0.10.0070.04720.26
7.0.00.0100.05320.09
5.6.210.0200.07720.48
5.6.200.0070.07718.21
5.6.190.0170.06320.39
5.6.180.0370.04720.67
5.6.170.0200.04720.52
5.6.160.0030.08720.54
5.6.150.0130.06018.12
5.6.140.0170.07018.15
5.6.130.0070.05318.12
5.6.120.0170.05020.96
5.6.110.0100.08321.02
5.6.100.0030.04721.11
5.6.90.0130.06021.08
5.6.80.0130.06720.36
5.5.350.0330.06720.44
5.5.340.0070.05318.08
5.5.330.0030.04320.28
5.5.320.0000.05720.28
5.5.310.0170.08320.32
5.5.300.0100.05718.05
5.5.290.0100.04018.01
5.5.280.0000.09020.88
5.5.270.0030.04020.88
5.5.260.0100.04320.80
5.5.250.0100.06320.55
5.5.240.4300.04020.38
5.4.450.0000.04719.57
5.4.440.0170.03019.55
5.4.430.0070.04019.46
5.4.420.0030.05319.30
5.4.410.0170.04019.39
5.4.400.0100.04019.32
5.4.390.0130.04318.95
5.4.380.0270.02719.21
5.4.370.0100.04019.32
5.4.360.0070.04019.11
5.4.350.0170.03719.36
5.4.340.0200.03319.25
5.4.320.0130.03719.15
5.4.310.0170.03319.14
5.4.300.0030.07019.22
5.4.290.0030.05719.16
5.4.280.0030.07718.99
5.4.270.0000.07719.24
5.4.260.0070.03319.04
5.4.250.0030.08019.09
5.4.240.0170.04718.94
5.4.230.0130.07019.08
5.4.220.0100.07019.17
5.4.210.0100.07719.21
5.4.200.0070.05719.21
5.4.190.0000.05318.96
5.4.180.0000.08019.07
5.4.170.0070.05719.12
5.4.160.0070.07319.20
5.4.150.0030.07719.04
5.4.140.0030.07716.42
5.4.130.0030.07016.43
5.4.120.0030.04716.43
5.4.110.0100.05716.50
5.4.100.0030.07016.47
5.4.90.0070.04016.31
5.4.80.0000.05016.59
5.4.70.0000.07316.50
5.4.60.0000.05016.56
5.4.50.0000.07716.23
5.4.40.0030.04716.34
5.4.30.0030.07316.54
5.4.20.0030.05716.55
5.4.10.0000.06316.37
5.4.00.0000.04315.81
5.3.290.0170.03314.75
5.3.280.0070.07314.51
5.3.270.0100.07014.58
5.3.260.0070.07314.62
5.3.250.0200.03714.77
5.3.240.0100.06714.54
5.3.230.0170.05014.57
5.3.220.0030.05014.57
5.3.210.0070.08014.66
5.3.200.0030.06014.48
5.3.190.0000.05014.62
5.3.180.0030.04714.57
5.3.170.0030.04714.59
5.3.160.0030.07714.61
5.3.150.0070.05314.57
5.3.140.0070.07014.58
5.3.130.0030.05714.53
5.3.120.0030.07314.48
5.3.110.0070.05314.63
5.3.100.0030.07014.27
5.3.90.0070.03714.04
5.3.80.0030.06714.00
5.3.70.0030.04313.96
5.3.60.0030.04313.91
5.3.50.0030.07313.87
5.3.40.0030.05713.88
5.3.30.0070.06313.83
5.3.20.0070.06713.71
5.3.10.0070.04313.59
5.3.00.0030.06013.62
5.2.170.0070.05312.30
5.2.160.0030.06012.30
5.2.150.0070.05312.30
5.2.140.0030.05712.30
5.2.130.0030.05312.30
5.2.120.0030.06312.30
5.2.110.0030.04012.30
5.2.100.0070.05012.30
5.2.90.0000.06712.30
5.2.80.0030.05712.30
5.2.70.0000.05312.30
5.2.60.0030.04312.30
5.2.50.0130.05312.30
5.2.40.0030.04012.30
5.2.30.0000.06712.30
5.2.20.0070.05712.30
5.2.10.0100.04012.30
5.2.00.0000.06712.30
5.1.60.0070.03712.30
5.1.50.0030.04012.30
5.1.40.0000.04312.30
5.1.30.0030.06012.30
5.1.20.0000.05312.30
5.1.10.0030.05312.30
5.1.00.0030.05312.30
5.0.50.0030.04312.30
5.0.40.0070.03712.30
5.0.30.0030.06312.30
5.0.20.0000.03312.30
5.0.10.0000.04312.30
5.0.00.0070.05312.30
4.4.90.0030.03012.30
4.4.80.0030.02312.30
4.4.70.0030.02712.30
4.4.60.0000.03712.30
4.4.50.0000.03712.30
4.4.40.0000.03712.30
4.4.30.0030.02712.30
4.4.20.0000.04012.30
4.4.10.0070.03012.30
4.4.00.0000.05012.30
4.3.110.0070.02712.30
4.3.100.0000.03312.30
4.3.90.0000.02012.30
4.3.80.0100.04012.30
4.3.70.0030.03012.30
4.3.60.0030.03312.30
4.3.50.0100.02712.30
4.3.40.0000.05312.30
4.3.30.0000.04012.30
4.3.20.0000.03312.30
4.3.10.0070.02012.30
4.3.00.0000.03012.30

preferences:
46 ms | 401 KiB | 5 Q