3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $name = 'a'; private $value = null; public function __construct() { $this->value = 1; } } class B { public $name = 'b'; private $differentValue = null; public function __construct() { $this->differentValue = 1; } } class CD { private $parent = null; public function __construct($parent) { $this->parent = new $parent; } public function __call($name, $params) { if ( is_callable([$this->parent, $name]) ) { return call_user_func_array(array($this->parent, $name), $params); } else { throw new Exception('Method "'.$name.'" should be callable.'); } } public function __get($property_name){ if(isset($this->$property_name)) { return $this->$property_name; } elseif (isset($this->parent->$property_name)) { return $this->parent->$property_name; } else { return null; } } public function display() { echo "OK"; } } $c = new CD(new B); var_dump($c->name);

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.0130.01316.50
8.3.60.0080.00816.63
8.3.50.0090.00922.04
8.3.40.0070.00718.64
8.3.30.0120.00919.05
8.3.20.0020.00520.16
8.3.10.0000.00821.91
8.3.00.0050.00319.25
8.2.190.0170.00316.58
8.2.180.0050.01416.75
8.2.170.0100.01022.96
8.2.160.0100.00720.34
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0000.00726.16
8.2.120.0080.00019.54
8.2.110.0030.00722.32
8.2.100.0060.00617.63
8.2.90.0050.00319.18
8.2.80.0030.00617.97
8.2.70.0040.00417.50
8.2.60.0040.00418.02
8.2.50.0060.00318.07
8.2.40.0040.00419.94
8.2.30.0040.00418.07
8.2.20.0060.00317.74
8.2.10.0000.00818.09
8.2.00.0040.00417.72
8.1.280.0070.01425.92
8.1.270.0030.00620.64
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00321.05
8.1.230.0040.00717.66
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.00917.48
8.1.190.0040.00417.48
8.1.180.0070.00018.10
8.1.170.0030.00620.28
8.1.160.0000.00722.02
8.1.150.0040.00418.89
8.1.140.0080.00017.38
8.1.130.0000.00717.73
8.1.120.0040.00417.36
8.1.110.0040.00417.35
8.1.100.0000.00717.49
8.1.90.0000.00717.35
8.1.80.0040.00417.46
8.1.70.0030.00317.45
8.1.60.0060.00317.59
8.1.50.0030.00517.42
8.1.40.0060.00617.50
8.1.30.0030.00517.52
8.1.20.0000.00817.59
8.1.10.0030.00617.56
8.1.00.0000.00817.53
8.0.300.0000.00818.77
8.0.290.0050.00216.63
8.0.280.0040.00418.42
8.0.270.0000.00717.18
8.0.260.0050.00217.27
8.0.250.0040.00416.87
8.0.240.0070.00016.95
8.0.230.0030.00316.83
8.0.220.0030.00316.96
8.0.210.0040.00416.79
8.0.200.0040.00416.82
8.0.190.0030.00316.93
8.0.180.0050.00316.95
8.0.170.0030.00516.91
8.0.160.0070.00016.95
8.0.150.0050.00316.91
8.0.140.0000.00716.82
8.0.130.0030.00613.27
8.0.120.0000.00816.82
8.0.110.0000.00716.73
8.0.100.0080.00016.77
8.0.90.0000.00716.97
8.0.80.0090.00616.95
8.0.70.0080.00016.89
8.0.60.0000.00816.91
8.0.50.0000.00816.83
8.0.30.0090.01417.27
8.0.20.0110.00717.40
8.0.10.0000.00817.04
8.0.00.0030.01416.71
7.4.330.0050.00015.05
7.4.320.0030.00316.63
7.4.300.0000.00616.52
7.4.290.0000.00716.60
7.4.280.0020.00516.51
7.4.270.0080.00016.54
7.4.260.0070.00016.48
7.4.250.0040.00416.38
7.4.240.0030.00516.46
7.4.230.0030.00316.35
7.4.220.0060.01316.70
7.4.210.0100.00416.54
7.4.200.0040.00416.57
7.4.160.0140.00316.49
7.4.150.0080.01017.40
7.4.140.0120.00817.86
7.4.130.0080.00816.56
7.4.120.0100.00816.58
7.4.110.0070.01116.48
7.4.100.0090.00916.49
7.4.90.0170.00716.63
7.4.80.0180.00619.39
7.4.70.0090.00616.60
7.4.60.0030.01316.56
7.4.50.0020.00316.52
7.4.40.0090.00916.70
7.4.30.0070.01016.65
7.4.00.0060.01214.83
7.3.330.0000.00613.35
7.3.320.0130.00013.34
7.3.310.0040.00416.33
7.3.300.0000.00716.29
7.3.290.0080.00716.41
7.3.280.0040.01216.33
7.3.270.0090.00917.40
7.3.260.0100.00616.42
7.3.250.0100.00716.34
7.3.240.0100.00616.52
7.3.230.0170.00616.39
7.3.210.0180.00016.37
7.3.200.0100.00719.39
7.3.190.0070.01016.55
7.3.180.0060.00916.37
7.3.170.0140.00316.53
7.3.160.0090.01416.42
7.2.330.0110.01216.64
7.2.320.0030.01316.78
7.2.310.0050.01116.54
7.2.300.0060.01116.64
7.2.290.0100.00716.71
7.2.60.0130.00016.82
7.2.00.0030.00919.22
7.1.200.0030.01015.73
7.1.100.0030.00618.08
7.1.70.0110.00717.11
7.1.60.0100.01419.50
7.1.50.0100.01016.63
7.1.00.0100.07022.51
7.0.200.0150.00414.90
7.0.140.0070.06722.01
7.0.60.0130.08319.94
7.0.50.0070.05017.90
7.0.40.0030.04320.08
7.0.30.0300.05720.26
7.0.20.0100.04720.15
7.0.10.0170.04320.05
7.0.00.0070.05320.34
5.6.280.0100.06320.91
5.6.210.0030.05020.51
5.6.200.0070.08018.18
5.6.190.0100.03720.60
5.6.180.0300.05020.56
5.6.170.0400.07320.55
5.6.160.0070.08320.44
5.6.150.0100.04018.22
5.6.140.0070.03718.18
5.6.130.0100.07718.14
5.6.120.0200.07321.13
5.6.110.0030.05321.15
5.6.100.0030.04320.98
5.6.90.0070.06321.02
5.6.80.0030.03720.39
5.5.350.0170.08320.43
5.5.340.0100.04018.01
5.5.330.0130.08020.13
5.5.320.0070.04720.57
5.5.310.0230.05320.35
5.5.300.0030.04017.95
5.5.290.0100.08317.98
5.5.280.0070.04320.89
5.5.270.0030.04020.88
5.5.260.0070.06020.97
5.5.250.0070.03720.61
5.5.240.0000.06320.20
5.4.450.0670.06319.54
5.4.440.0600.06319.71
5.4.430.0130.06019.61
5.4.420.0270.05719.57
5.4.410.0730.05719.45
5.4.400.1000.07318.85
5.4.390.0730.05718.71
5.4.380.3200.06718.63
5.4.370.2430.04018.75
5.4.360.0730.05318.48
5.4.350.0670.06318.48
5.4.340.0930.05718.73
5.4.320.0830.05718.58
5.4.310.0700.05318.56
5.4.300.0870.06318.53
5.4.290.0770.04718.79
5.4.280.0870.05018.50
5.4.270.0770.05318.41
5.4.260.0770.05018.56
5.4.250.0930.05018.47
5.4.240.2070.05718.60
5.4.230.0830.05018.57
5.4.220.0730.05718.68
5.4.210.0730.06318.69
5.4.200.0770.04716.70
5.4.190.0730.06318.75
5.4.180.1030.04718.75
5.4.170.0870.05718.52
5.4.160.1000.05018.64
5.4.150.1830.05018.70
5.4.140.0870.05316.17
5.4.130.0730.05316.28
5.4.120.0670.05716.35
5.4.110.1770.05716.23
5.4.100.0700.06316.44
5.4.90.0970.05016.25
5.4.80.0830.05016.29
5.4.70.0830.05016.30
5.4.60.0900.05716.22
5.4.50.0930.05016.22
5.4.40.1630.07016.15
5.4.30.0800.04716.25
5.4.20.0800.05316.28
5.4.10.0830.04016.14
5.4.00.1770.04315.78
5.3.290.0770.05014.88
5.3.280.0900.04714.62
5.3.270.0900.04714.61
5.3.260.1670.06014.74
5.3.250.0670.05714.61
5.3.240.0730.06714.64
5.3.230.0630.06314.62
5.3.220.1630.04314.57
5.3.210.0970.06314.74
5.3.200.0870.05714.74
5.3.190.1030.04714.67
5.3.180.0800.05714.68
5.3.170.0800.05714.59
5.3.160.0870.05714.60
5.3.150.0770.07314.61
5.3.140.0900.05014.67
5.3.130.0830.05014.59
5.3.120.0770.06014.59
5.3.110.0530.06714.66
5.3.100.0730.05314.03
5.3.90.0300.05014.01
5.3.80.0170.05714.14
5.3.70.0230.05314.02
5.3.60.0270.05714.08
5.3.50.0200.05714.16
5.3.40.0230.05014.18
5.3.30.0200.05713.93
5.3.20.0200.05013.73
5.3.10.0170.05013.71
5.3.00.0270.04713.71
5.2.170.0170.04711.19
5.2.160.0170.06011.20
5.2.150.0270.04311.17
5.2.140.0170.04311.18
5.2.130.0200.03711.33
5.2.120.0230.04711.15
5.2.110.0200.04311.23
5.2.100.0270.04711.13
5.2.90.0230.03711.21
5.2.80.0200.04711.20
5.2.70.0330.04011.21
5.2.60.0200.04011.12
5.2.50.0170.04011.12
5.2.40.0200.03311.21
5.2.30.0130.06311.02
5.2.20.0170.04710.95
5.2.10.0130.05010.85
5.2.00.0230.05010.72
5.1.60.0130.03710.08
5.1.50.0100.04010.18
5.1.40.0130.03310.01
5.1.30.0100.04010.34
5.1.20.0170.04010.47
5.1.10.0170.03010.18
5.1.00.0170.04010.25
5.0.50.0200.0208.68
5.0.40.0030.0338.61
5.0.30.0130.0408.43
5.0.20.0100.0308.24
5.0.10.0130.0238.39
5.0.00.0100.0478.21
4.4.90.0000.0275.92
4.4.80.0100.0235.90
4.4.70.0130.0275.85
4.4.60.0070.0235.87
4.4.50.0070.0235.87
4.4.40.0130.0405.86
4.4.30.0070.0275.95
4.4.20.0030.0275.97
4.4.10.0130.0205.96
4.4.00.0070.0336.03
4.3.110.0030.0275.90
4.3.100.0100.0205.84
4.3.90.0170.0205.89
4.3.80.0070.0435.89
4.3.70.0070.0235.78
4.3.60.0070.0205.76
4.3.50.0030.0275.83
4.3.40.0030.0375.77
4.3.30.0030.0234.57
4.3.20.0130.0134.62
4.3.10.0030.0234.52
4.3.00.0070.0277.11

preferences:
50.44 ms | 401 KiB | 5 Q