3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass { private $name = 'Parent'; public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } } class Child extends ParentClass { public $name = 'Child'; } $parent = new ParentClass(); echo "\nParent name: " . $parent->getName(); echo "\nSetting parent name to 'old'"; $parent->setName('old'); echo "\nParent name after change: " . $parent->getName(); $child = new Child(); echo "\nChild name by getter: " . $child->getName(); echo "\nChild name by prop: " . $child->name; var_export($child);

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.01416.63
8.3.50.0060.01221.17
8.3.40.0100.01018.84
8.3.30.0030.01419.13
8.3.20.0110.00420.18
8.3.10.0040.00421.77
8.3.00.0070.00317.63
8.2.180.0070.01116.38
8.2.170.0100.00322.96
8.2.160.0140.00020.52
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0060.01226.16
8.2.120.0040.00422.20
8.2.110.0040.00422.28
8.2.100.0090.00317.89
8.2.90.0040.00417.63
8.2.80.0040.00418.04
8.2.70.0050.00318.04
8.2.60.0040.00418.04
8.2.50.0000.00818.10
8.2.40.0040.00420.55
8.2.30.0040.00417.93
8.2.20.0040.00417.57
8.2.10.0000.00818.11
8.2.00.0040.00418.09
8.1.280.0060.01525.92
8.1.270.0160.00320.12
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.92
8.1.230.0100.00319.10
8.1.220.0040.00817.74
8.1.210.0040.00418.77
8.1.200.0070.00517.35
8.1.190.0060.00317.35
8.1.180.0050.00318.10
8.1.170.0040.00418.57
8.1.160.0040.00421.89
8.1.150.0000.00718.69
8.1.140.0030.00617.37
8.1.130.0000.00817.65
8.1.120.0000.00717.29
8.1.110.0030.00517.40
8.1.100.0050.00217.38
8.1.90.0020.00517.38
8.1.80.0040.00417.35
8.1.70.0070.00017.36
8.1.60.0040.00417.61
8.1.50.0000.00717.45
8.1.40.0040.00417.51
8.1.30.0030.00517.70
8.1.20.0000.00817.54
8.1.10.0060.00317.64
8.1.00.0060.00617.47
8.0.300.0000.00721.56
8.0.290.0030.00516.74
8.0.280.0030.00318.45
8.0.270.0000.00717.23
8.0.260.0030.00317.24
8.0.250.0030.00316.95
8.0.240.0000.00616.92
8.0.230.0040.00416.99
8.0.220.0030.00316.79
8.0.210.0000.00716.77
8.0.200.0000.00616.98
8.0.190.0000.00716.91
8.0.180.0030.01016.80
8.0.170.0000.00716.80
8.0.160.0020.00516.84
8.0.150.0000.00716.75
8.0.140.0000.00716.75
8.0.130.0050.00213.35
8.0.120.0040.00416.88
8.0.110.0040.00416.79
8.0.100.0040.00416.95
8.0.90.0040.00316.68
8.0.80.0080.01516.84
8.0.70.0040.00416.80
8.0.60.0030.00616.86
8.0.50.0040.00416.93
8.0.30.0100.00816.97
8.0.20.0080.01117.40
8.0.10.0020.00516.96
8.0.00.0080.01016.68
7.4.330.0050.00015.04
7.4.320.0000.00616.48
7.4.300.0060.00016.61
7.4.290.0000.00716.49
7.4.280.0000.00816.57
7.4.270.0040.00416.64
7.4.260.0030.00316.57
7.4.250.0000.00816.61
7.4.240.0000.00716.62
7.4.230.0000.00716.30
7.4.220.0070.01416.67
7.4.210.0070.00716.53
7.4.200.0040.00416.40
7.4.160.0120.00316.50
7.4.150.0120.00617.40
7.4.140.0120.00917.86
7.4.130.0140.00416.57
7.4.120.0070.01016.44
7.4.110.0060.01216.46
7.4.100.0130.00816.47
7.4.90.0140.00716.63
7.4.80.0060.01019.39
7.4.70.0070.01116.29
7.4.60.0100.00716.43
7.4.50.0000.00616.70
7.4.40.0070.01016.66
7.4.30.0100.01016.43
7.4.00.0030.01015.16
7.3.330.0020.00513.33
7.3.320.0000.00613.26
7.3.310.0030.00316.18
7.3.300.0000.00616.32
7.3.290.0110.00316.29
7.3.280.0080.00816.29
7.3.270.0160.00317.40
7.3.260.0090.00816.37
7.3.240.0120.00616.54
7.3.230.0070.01016.47
7.3.210.0030.01916.32
7.3.200.0120.01219.39
7.3.190.0100.00616.61
7.3.180.0090.00616.33
7.3.170.0090.00916.50
7.3.160.0140.00716.32
7.3.10.0110.00416.52
7.3.00.0070.01116.81
7.2.330.0070.01316.47
7.2.320.0080.00816.75
7.2.310.0060.00916.61
7.2.300.0110.00616.45
7.2.290.0060.01216.55
7.2.130.0000.01816.84
7.2.120.0070.01017.01
7.2.110.0130.00016.85
7.2.100.0060.00617.08
7.2.90.0040.01116.86
7.2.80.0070.00716.95
7.2.70.0060.00916.79
7.2.60.0040.01216.71
7.2.50.0040.01216.71
7.2.40.0060.00616.86
7.2.30.0000.01416.92
7.2.20.0030.01416.62
7.2.10.0040.00816.61
7.2.00.0120.00316.60
7.1.250.0070.00415.57
7.1.200.0030.00715.86
7.1.70.0000.00916.88
7.1.60.0000.01419.59
7.1.50.0100.01316.84
7.1.00.0000.08022.36
7.0.200.0000.00716.82
7.0.60.0030.04020.06
7.0.50.0000.08317.86
7.0.40.0100.08720.10
7.0.30.0270.07320.23
7.0.20.0200.04720.10
7.0.10.0070.07720.13
7.0.00.0230.05020.25
5.6.280.0030.07320.93
5.6.210.0030.08320.70
5.6.200.0130.07718.13
5.6.190.0070.08320.41
5.6.180.0400.07320.48
5.6.170.0230.05020.62
5.6.160.0030.04020.52
5.6.150.0100.06318.12
5.6.140.0030.04018.24
5.6.130.0070.07718.13
5.6.120.0030.06021.01
5.6.110.0130.05721.11
5.6.100.0070.08320.99
5.6.90.0030.04720.98
5.6.80.0070.08320.39
5.5.350.0300.05320.49
5.5.340.0170.07018.09
5.5.330.0030.09020.21
5.5.320.0070.04020.42
5.5.310.0230.04320.25
5.5.300.0100.05317.98
5.5.290.0000.04317.93
5.5.280.0070.04020.86
5.5.270.0170.06720.63
5.5.260.0100.06020.88
5.5.250.0070.06320.62
5.5.240.0070.07720.27
5.4.450.0130.06019.30
5.4.440.0670.05319.59
5.4.430.0770.05719.39
5.4.420.0730.05019.48
5.4.410.0800.04019.45
5.4.400.0770.05319.22
5.4.390.0730.04719.07
5.4.380.0700.05019.32
5.4.370.0730.04719.32
5.4.360.0700.05318.88
5.4.350.0700.05018.89
5.4.340.0730.04719.24
5.4.320.0700.05019.23
5.4.310.0730.04319.22
5.4.300.0730.05019.20
5.4.290.0600.06019.23
5.4.280.0570.06719.10
5.4.270.0630.05318.98
5.4.260.0830.03719.16
5.4.250.0630.05319.15
5.4.240.0670.06719.21
5.4.230.0670.05319.10
5.4.220.0700.05019.20
5.4.210.0800.04019.18
5.4.200.0670.05016.67
5.4.190.0700.05019.26
5.4.180.0670.05019.23
5.4.170.0670.05319.13
5.4.160.0670.05019.25
5.4.150.0630.05719.25
5.4.140.0670.05316.64
5.4.130.0700.04716.49
5.4.120.0730.05716.33
5.4.110.0700.04716.63
5.4.100.0670.05016.41
5.4.90.0770.04316.50
5.4.80.0630.05316.66
5.4.70.0700.04716.45
5.4.60.0670.05016.45
5.4.50.0630.05316.38
5.4.40.0770.04316.60
5.4.30.0670.04716.44
5.4.20.0700.05016.39
5.4.10.0630.05316.25
5.4.00.0770.05315.71
5.3.290.0430.06714.63
5.3.280.0570.05314.56
5.3.270.0630.04714.62
5.3.260.0630.05714.76
5.3.250.0730.04714.62
5.3.240.0670.05314.55
5.3.230.0730.04714.56
5.3.220.0700.05014.71
5.3.210.0670.05714.51
5.3.200.0770.04314.58
5.3.190.0770.05314.72
5.3.180.0600.06014.72
5.3.170.0770.03714.62
5.3.160.0630.06314.53
5.3.150.0600.05014.49
5.3.140.0600.05014.41
5.3.130.0700.04714.67
5.3.120.0570.05314.46
5.3.110.0470.06314.54
5.3.100.0600.05014.00
5.3.90.0500.06014.10
5.3.80.0700.05713.93
5.3.70.0630.07013.93
5.3.60.0570.05314.00
5.3.50.0770.04713.81
5.3.40.0600.04713.93
5.3.30.0630.04313.83
5.3.20.0730.05013.59
5.3.10.0770.04013.56
5.3.00.0600.05013.63
5.2.170.0600.04011.09
5.2.160.0630.04311.11
5.2.150.0570.04311.32
5.2.140.0630.03311.06
5.2.130.0470.04311.12
5.2.120.0570.03711.28
5.2.110.0600.03711.07
5.2.100.0430.04310.98
5.2.90.0800.04711.11
5.2.80.0470.04711.11
5.2.70.0630.04011.27
5.2.60.0500.04010.95
5.2.50.0500.04010.94
5.2.40.0370.04310.96
5.2.30.0530.04010.92
5.2.20.0430.03310.89
5.2.10.0470.05010.81
5.2.00.0500.04310.88
5.1.60.0500.0409.85
5.1.50.0400.03310.04
5.1.40.0430.0309.93
5.1.30.0630.04010.52
5.1.20.0630.04310.39
5.1.10.0470.03010.22
5.1.00.0430.03310.05
5.0.50.0130.0378.55
5.0.40.0230.0278.35
5.0.30.0200.0438.23
5.0.20.0170.0338.36
5.0.10.0230.0278.09
5.0.00.0230.0408.16
4.4.90.0200.0235.88
4.4.80.0270.0305.83
4.4.70.0270.0305.91
4.4.60.0270.0275.75
4.4.50.0300.0205.75
4.4.40.0230.0335.90
4.4.30.0270.0175.85
4.4.20.0200.0235.92
4.4.10.0170.0275.82
4.4.00.0300.0275.93
4.3.110.0230.0205.77
4.3.100.0200.0235.78
4.3.90.0270.0175.64
4.3.80.0330.0235.80
4.3.70.0200.0235.75
4.3.60.0300.0105.77
4.3.50.0330.0135.63
4.3.40.0200.0335.62
4.3.30.0100.0204.58
4.3.20.0130.0204.49
4.3.10.0200.0134.37
4.3.00.0030.0237.51

preferences:
63.94 ms | 401 KiB | 5 Q