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; $reflect = new ReflectionClass($child); $props = $reflect->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED | \ReflectionProperty::IS_PRIVATE); foreach ($props as $prop) { echo "\nChild property: " . $prop->getName(); }

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.0040.01518.43
8.3.50.0110.00821.04
8.3.40.0090.00618.77
8.3.30.0040.01419.22
8.3.20.0110.00420.24
8.3.10.0030.00621.64
8.3.00.0100.00017.63
8.2.180.0070.01116.34
8.2.170.0060.00922.96
8.2.160.0100.00320.39
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0040.00422.29
8.2.110.0150.00622.25
8.2.100.0160.00017.78
8.2.90.0000.00817.63
8.2.80.0000.00717.97
8.2.70.0040.00417.80
8.2.60.0040.00417.93
8.2.50.0040.00418.10
8.2.40.0050.00320.25
8.2.30.0050.00318.00
8.2.20.0040.00417.67
8.2.10.0040.00418.13
8.2.00.0000.00718.09
8.1.280.0130.00725.92
8.1.270.0060.00920.33
8.1.260.0000.00926.35
8.1.250.0000.00728.09
8.1.240.0030.01323.99
8.1.230.0080.00320.89
8.1.220.0070.00417.74
8.1.210.0000.00818.77
8.1.200.0090.00317.23
8.1.190.0090.00017.25
8.1.180.0000.00818.10
8.1.170.0080.00018.39
8.1.160.0000.00822.01
8.1.150.0060.00318.98
8.1.140.0050.00217.45
8.1.130.0030.00317.70
8.1.120.0070.00017.54
8.1.110.0000.00817.51
8.1.100.0000.00717.37
8.1.90.0020.00517.43
8.1.80.0080.00017.52
8.1.70.0000.00717.49
8.1.60.0080.00017.55
8.1.50.0000.00817.54
8.1.40.0080.00017.38
8.1.30.0080.00017.69
8.1.20.0040.00417.52
8.1.10.0040.00417.61
8.1.00.0020.00917.38
8.0.300.0080.00021.38
8.0.290.0040.00416.63
8.0.280.0030.00318.32
8.0.270.0000.00717.13
8.0.260.0000.00717.34
8.0.250.0050.00316.92
8.0.240.0040.00417.00
8.0.230.0000.00716.88
8.0.220.0000.00716.86
8.0.210.0040.00416.89
8.0.200.0060.00016.88
8.0.190.0000.00717.02
8.0.180.0070.00516.97
8.0.170.0040.00416.85
8.0.160.0030.00316.95
8.0.150.0030.00516.73
8.0.140.0040.00416.92
8.0.130.0040.00413.32
8.0.120.0050.00316.82
8.0.110.0040.00416.91
8.0.100.0000.00816.82
8.0.90.0030.00316.74
8.0.80.0100.00616.90
8.0.70.0050.00216.86
8.0.60.0030.00616.83
8.0.50.0040.00416.93
8.0.30.0080.01217.01
8.0.20.0100.01117.40
8.0.10.0000.00717.05
8.0.00.0060.01216.79
7.4.330.0000.00515.09
7.4.320.0000.00616.50
7.4.300.0060.00016.66
7.4.290.0070.00016.49
7.4.280.0040.00416.39
7.4.270.0000.00716.62
7.4.260.0000.00716.61
7.4.250.0030.00516.38
7.4.240.0050.00216.49
7.4.230.0070.00016.50
7.4.220.0120.00616.40
7.4.210.0110.00416.69
7.4.200.0020.00516.36
7.4.160.0080.00816.57
7.4.150.0100.00717.40
7.4.140.0070.01117.86
7.4.130.0140.00416.60
7.4.120.0090.00716.63
7.4.110.0110.00816.42
7.4.100.0070.01316.43
7.4.90.0090.00916.42
7.4.80.0030.01319.39
7.4.70.0100.01016.50
7.4.60.0100.00916.50
7.4.50.0000.00816.35
7.4.40.0120.01016.48
7.4.30.0140.00916.57
7.4.00.0000.01614.89
7.3.330.0050.00013.25
7.3.320.0000.00513.29
7.3.310.0030.00316.35
7.3.300.0070.00016.16
7.3.290.0120.00216.29
7.3.280.0030.01216.34
7.3.270.0220.00317.40
7.3.260.0100.00616.36
7.3.240.0030.01416.38
7.3.230.0090.00916.43
7.3.210.0140.00316.36
7.3.200.0090.00919.39
7.3.190.0060.01016.28
7.3.180.0100.01016.59
7.3.170.0130.00316.57
7.3.160.0120.00916.41
7.2.330.0080.00816.70
7.2.320.0100.00716.55
7.2.310.0140.00316.73
7.2.300.0070.01016.52
7.2.290.0060.01216.80
7.2.60.0060.01016.98
7.2.00.0000.01819.53
7.1.200.0000.01015.73
7.1.100.0030.01018.19
7.1.70.0000.01017.20
7.1.60.0070.01719.59
7.1.50.0040.00717.04
7.1.00.0000.08022.30
7.0.200.0080.00016.87
7.0.60.0030.04019.91
7.0.50.0070.08017.88
7.0.40.0030.08320.10
7.0.30.0330.07020.18
7.0.20.0300.04720.08
7.0.10.0070.08720.24
7.0.00.0100.08020.06
5.6.280.0130.06320.92
5.6.210.0100.07320.75
5.6.200.0100.05018.19
5.6.190.0070.08020.57
5.6.180.0430.06720.54
5.6.170.0230.05020.71
5.6.160.0030.04320.39
5.6.150.0130.08018.13
5.6.140.0070.04318.18
5.6.130.0070.05318.09
5.6.120.0100.04021.01
5.6.110.0100.09021.12
5.6.100.0030.06020.96
5.6.90.0070.04021.13
5.6.80.0070.08020.38
5.5.350.0200.08020.43
5.5.340.0030.08318.02
5.5.330.0000.05020.27
5.5.320.0030.04720.27
5.5.310.0170.05020.56
5.5.300.0030.05317.98
5.5.290.0000.04317.93
5.5.280.0070.05320.75
5.5.270.0130.08020.79
5.5.260.0100.04320.89
5.5.250.0170.07320.62
5.5.240.0000.06720.25
5.4.450.0170.05319.57
5.4.440.0570.06019.60
5.4.430.0630.05019.39
5.4.420.0670.04719.43
5.4.410.0770.06319.46
5.4.400.0570.05319.11
5.4.390.0770.05019.16
5.4.380.0600.05319.15
5.4.370.0800.04319.31
5.4.360.0630.05319.32
5.4.350.0700.04319.11
5.4.340.0600.05719.22
5.4.320.0500.06019.17
5.4.310.0670.04018.88
5.4.300.0470.06019.27
5.4.290.0570.05319.06
5.4.280.0630.05718.99
5.4.270.0600.05018.88
5.4.260.0570.05719.10
5.4.250.0570.05319.17
5.4.240.0570.05719.15
5.4.230.0600.06318.89
5.4.220.0670.06018.88
5.4.210.0600.05018.89
5.4.200.0700.04716.82
5.4.190.0630.05319.13
5.4.180.0670.04319.13
5.4.170.0700.04718.98
5.4.160.0570.05019.05
5.4.150.0700.05019.21
5.4.140.0670.05316.69
5.4.130.0670.05016.59
5.4.120.0630.04316.40
5.4.110.0630.04016.49
5.4.100.0700.04716.35
5.4.90.0670.05316.70
5.4.80.0670.05016.30
5.4.70.0770.04016.61
5.4.60.0700.04716.60
5.4.50.0670.04716.45
5.4.40.0700.04716.23
5.4.30.0600.05316.64
5.4.20.0700.04716.51
5.4.10.0870.06316.30
5.4.00.0600.04315.71
5.3.290.0700.05014.89
5.3.280.0600.05014.67
5.3.270.0800.04314.61
5.3.260.0670.05714.66
5.3.250.0870.05314.57
5.3.240.0670.05714.83
5.3.230.0770.04714.60
5.3.220.0570.05714.75
5.3.210.0600.05314.59
5.3.200.0700.04314.59
5.3.190.0600.05014.53
5.3.180.0530.05314.54
5.3.170.0570.05014.52
5.3.160.0570.05014.55
5.3.150.0700.04714.56
5.3.140.0530.05714.65
5.3.130.0570.05314.66
5.3.120.0530.05714.76
5.3.110.0500.06014.57
5.3.100.0500.05714.00
5.3.90.0730.04314.10
5.3.80.0630.04714.10
5.3.70.0470.06714.07
5.3.60.0730.05314.20
5.3.50.0700.04314.20
5.3.40.0500.05714.00
5.3.30.0530.05313.96
5.3.20.0630.04313.92
5.3.10.0600.05713.69
5.3.00.0570.05713.70
5.2.170.0500.05311.30
5.2.160.0500.04011.23
5.2.150.0430.04711.16
5.2.140.0470.04311.30
5.2.130.0430.04311.28
5.2.120.0570.04711.23
5.2.110.0430.04311.22
5.2.100.0530.03011.07
5.2.90.0530.03311.18
5.2.80.0470.04011.11
5.2.70.0530.03711.25
5.2.60.0400.04711.16
5.2.50.0530.05011.01
5.2.40.0300.04711.06
5.2.30.0400.05310.98
5.2.20.0470.04310.88
5.2.10.0330.04310.92
5.2.00.0300.04710.64
5.1.60.0430.0339.92
5.1.50.0400.0309.89
5.1.40.0470.0339.94
5.1.30.0430.03710.38
5.1.20.0400.03310.42
5.1.10.0300.04010.13
5.1.00.0330.0379.97
5.0.50.0200.0278.45
5.0.40.0200.0278.46
5.0.30.0200.0408.35
5.0.20.0200.0278.32
5.0.10.0130.0338.03
5.0.00.0130.0478.10
4.4.90.0230.0205.86
4.4.80.0200.0235.85
4.4.70.0230.0205.89
4.4.60.0170.0235.74
4.4.50.0200.0205.89
4.4.40.0270.0305.75
4.4.30.0200.0235.84
4.4.20.0270.0175.98
4.4.10.0230.0205.93
4.4.00.0230.0335.77
4.3.110.0230.0205.79
4.3.100.0230.0205.66
4.3.90.0170.0235.68
4.3.80.0230.0305.75
4.3.70.0230.0175.66
4.3.60.0200.0205.74
4.3.50.0200.0205.67
4.3.40.0230.0375.61
4.3.30.0130.0204.44
4.3.20.0100.0234.55
4.3.10.0100.0234.50
4.3.00.0000.0277.51

preferences:
56.19 ms | 401 KiB | 5 Q