3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $data; private $relations; public function __set($name, $value) { $this->data[$name] = $value; } public function __get($name) { if(isset($this->data[$name])){ return $this->data[$name]; } if(method_exists('bar',$name)){ $getCalled = get_called_class(); return (new $getCalled())->$name(); } } public function __construct() { $this->data = ['foo' => 'test', 'body' => 'content']; } public function test() { $function = debug_backtrace()[1]['function']; echo $function; return $this->relations[$function] = ['a' =>'aa', 'b' =>'bb']; } } class bar extends foo{ public function aa(){ return $this->test(); } } $bar = new bar(); $bar->aa; print_r($bar);

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.0120.00616.75
8.3.50.0100.00716.14
8.3.40.0140.00318.84
8.3.30.0000.01518.69
8.3.20.0080.00020.34
8.3.10.0060.00323.36
8.3.00.0030.00717.78
8.2.180.0110.00716.88
8.2.170.0140.00022.96
8.2.160.0100.00320.11
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0040.00421.00
8.2.120.0040.00426.35
8.2.110.0060.00320.51
8.2.100.0030.00917.66
8.2.90.0030.00619.17
8.2.80.0080.00018.04
8.2.70.0060.00317.63
8.2.60.0030.00517.93
8.2.50.0050.00318.10
8.2.40.0050.00320.60
8.2.30.0060.00321.05
8.2.20.0050.00218.15
8.2.10.0000.00718.07
8.2.00.0040.00418.07
8.1.280.0160.00825.92
8.1.270.0080.00023.87
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0030.00619.44
8.1.230.0080.00417.77
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0070.00317.35
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0000.00818.46
8.1.160.0040.00419.05
8.1.150.0050.00220.65
8.1.140.0040.00419.59
8.1.130.0000.00718.86
8.1.120.0070.00017.34
8.1.110.0050.00317.43
8.1.100.0040.00417.38
8.1.90.0070.00017.39
8.1.80.0040.00417.29
8.1.70.0000.00717.45
8.1.60.0040.00417.61
8.1.50.0040.00417.58
8.1.40.0040.00417.44
8.1.30.0040.00417.58
8.1.20.0030.00517.58
8.1.10.0080.00017.63
8.1.00.0000.00717.55
8.0.300.0070.00018.77
8.0.290.0000.00816.63
8.0.280.0000.00718.51
8.0.270.0030.00317.29
8.0.260.0000.00716.83
8.0.250.0060.00016.95
8.0.240.0040.00416.87
8.0.230.0070.00316.91
8.0.220.0000.00716.89
8.0.210.0070.00016.80
8.0.200.0030.00316.83
8.0.190.0030.00616.71
8.0.180.0070.00016.74
8.0.170.0030.00316.88
8.0.160.0040.00416.82
8.0.150.0030.00316.78
8.0.140.0000.00716.83
8.0.130.0060.00013.27
8.0.120.0040.00416.73
8.0.110.0040.00416.75
8.0.100.0040.00416.77
8.0.90.0030.00516.71
8.0.80.0130.00416.85
8.0.70.0030.00516.91
8.0.60.0000.00716.87
8.0.50.0040.00416.84
8.0.30.0080.00917.10
8.0.20.0090.01117.41
8.0.10.0050.00217.04
8.0.00.0170.00716.61
7.4.330.0050.00015.55
7.4.320.0030.00316.62
7.4.300.0000.00616.53
7.4.290.0000.00816.48
7.4.280.0000.00816.46
7.4.270.0000.00716.57
7.4.260.0000.00513.23
7.4.250.0050.00316.41
7.4.240.0000.00716.44
7.4.230.0070.00016.54
7.4.220.0100.01716.43
7.4.210.0040.01016.55
7.4.200.0030.00316.66
7.4.160.0110.00616.54
7.4.150.0090.00817.40
7.4.140.0120.00617.86
7.4.130.0100.01016.41
7.4.120.0090.00916.56
7.4.110.0070.01016.57
7.4.100.0180.00416.52
7.4.90.0100.00716.59
7.4.80.0100.00719.39
7.4.70.0000.01816.67
7.4.60.0060.01016.71
7.4.50.0030.00616.60
7.4.40.0110.00616.61
7.4.30.0060.01216.55
7.4.00.0140.00315.00
7.3.330.0000.00613.34
7.3.320.0000.00613.38
7.3.310.0000.00716.40
7.3.300.0020.00516.34
7.3.290.0030.00316.25
7.3.280.0090.00916.35
7.3.270.0120.00617.40
7.3.260.0090.00816.44
7.3.250.0060.01516.53
7.3.240.0150.00516.61
7.3.230.0090.00916.35
7.3.210.0070.01316.49
7.3.200.0060.01016.28
7.3.190.0090.00616.39
7.3.180.0030.01616.23
7.3.170.0060.00916.52
7.3.160.0080.01516.29
7.2.330.0080.00916.54
7.2.320.0000.01716.73
7.2.310.0000.01616.78
7.2.300.0150.00616.47
7.2.290.0100.00716.69
7.2.90.0130.00514.86
7.2.80.2690.00915.06
7.2.70.2510.00715.29
7.2.60.3170.00315.03
7.2.50.0600.00615.18
7.2.40.2740.00614.92
7.2.30.1630.01015.15
7.2.20.0160.01314.84
7.2.10.1500.01015.10
7.2.00.0100.00815.16
7.1.210.0210.00713.95
7.1.200.1660.00914.04
7.1.190.0100.00614.00
7.1.180.4540.00613.86
7.1.170.2800.00314.14
7.1.160.3740.00313.95
7.1.150.1380.00314.12
7.1.140.0110.00813.81
7.1.130.1950.00914.03
7.1.120.0460.00713.93
7.1.110.0150.00614.06
7.1.100.0150.00614.05
7.1.90.0910.00714.14
7.1.80.0140.01113.80
7.1.70.0200.00913.94
7.1.60.0340.00931.65
7.1.50.1430.01331.87
7.1.40.1000.01031.75
7.1.30.0300.00832.14
7.1.20.0390.01631.99
7.1.10.0080.00814.16
7.1.00.0720.00014.02
7.0.310.0200.00013.61
7.0.300.2280.00313.78
7.0.290.2370.01313.66
7.0.280.1870.01013.64
7.0.270.0110.00813.32
7.0.260.2100.00613.68
7.0.250.2280.01013.60
7.0.240.0090.00913.67
7.0.230.0340.01013.44
7.0.220.0860.00613.69
7.0.210.0180.01513.80
7.0.200.0240.01613.77
7.0.190.0100.00713.45
7.0.180.0180.00613.51
7.0.170.0380.00313.66
7.0.160.0370.00313.47
7.0.150.0080.00513.50
7.0.140.0440.00513.63
7.0.130.0070.01013.79
7.0.120.0150.00913.58
7.0.110.0150.00313.60
7.0.100.0120.00913.52
7.0.90.0220.01013.80
7.0.80.0930.00913.32
7.0.70.0440.00613.59
7.0.60.0460.00913.65
7.0.50.1060.01313.82
7.0.40.0100.01013.71
7.0.30.0100.00613.70
7.0.20.0430.00313.73
7.0.10.1400.00313.80
7.0.00.1560.00013.54

preferences:
40.72 ms | 401 KiB | 5 Q