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]; } } public function __construct() { $this->data = ['foo' => 'test', 'body' => 'content']; } public function test() { $function = debug_backtrace()[1]['function']; $this->data[$function] = ['a' =>'aa', 'b' =>'bb']; return $this; } } class bar extends foo{ public function aa(){ return $this->test(); } } $bar = new bar(); echo $bar->foo; $a = $bar->aa()->aa; echo $a->a; 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.70.0090.00616.88
8.3.60.0090.00916.63
8.3.50.0090.00916.62
8.3.40.0040.01118.91
8.3.30.0090.00618.87
8.3.20.0000.00820.21
8.3.10.0000.00821.78
8.3.00.0030.00717.72
8.2.180.0040.01416.50
8.2.170.0140.00022.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00420.86
8.2.120.0040.00426.35
8.2.110.0040.00721.02
8.2.100.0090.00318.28
8.2.90.0000.00919.21
8.2.80.0040.00417.97
8.2.70.0040.00417.73
8.2.60.0040.00417.93
8.2.50.0030.00618.10
8.2.40.0070.00020.64
8.2.30.0000.00821.09
8.2.20.0000.00818.10
8.2.10.0080.00018.11
8.2.00.0040.00418.04
8.1.280.0170.00025.92
8.1.270.0070.00023.98
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.95
8.1.230.0040.00818.77
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0050.00517.22
8.1.190.0000.00917.22
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0000.00718.96
8.1.150.0070.00020.57
8.1.140.0040.00419.56
8.1.130.0000.00718.84
8.1.120.0050.00217.43
8.1.110.0040.00417.36
8.1.100.0050.00217.29
8.1.90.0040.00417.41
8.1.80.0040.00417.36
8.1.70.0000.00817.43
8.1.60.0000.00717.54
8.1.50.0000.00717.40
8.1.40.0000.00817.52
8.1.30.0030.00517.58
8.1.20.0000.00817.64
8.1.10.0080.00017.48
8.1.00.0000.00817.52
8.0.300.0040.00418.77
8.0.290.0030.00616.63
8.0.280.0060.00018.39
8.0.270.0000.00817.18
8.0.260.0060.00016.90
8.0.250.0030.00316.91
8.0.240.0080.00016.91
8.0.230.0070.00316.97
8.0.220.0030.00316.89
8.0.210.0040.00416.91
8.0.200.0030.00316.94
8.0.190.0040.00416.99
8.0.180.0070.00016.88
8.0.170.0000.00816.85
8.0.160.0030.00316.89
8.0.150.0000.00716.70
8.0.140.0040.00316.77
8.0.130.0050.00013.26
8.0.120.0050.00216.79
8.0.110.0000.00716.71
8.0.100.0040.00416.89
8.0.90.0030.00516.76
8.0.80.0070.01016.90
8.0.70.0050.00316.85
8.0.60.0000.00816.94
8.0.50.0020.00516.71
8.0.30.0060.01117.15
8.0.20.0170.00817.40
8.0.10.0040.00416.97
8.0.00.0120.00616.83
7.4.330.0000.00615.55
7.4.320.0000.00616.51
7.4.300.0000.00616.56
7.4.290.0040.00416.55
7.4.280.0000.00716.48
7.4.270.0000.00616.41
7.4.260.0000.00613.26
7.4.250.0000.00716.45
7.4.240.0030.00316.53
7.4.230.0070.00016.63
7.4.220.0060.01316.60
7.4.210.0000.01416.60
7.4.200.0070.00016.62
7.4.160.0110.00516.54
7.4.150.0070.01017.40
7.4.140.0080.01017.86
7.4.130.0110.00616.57
7.4.120.0100.01116.55
7.4.110.0070.01016.54
7.4.100.0080.01416.55
7.4.90.0090.00916.52
7.4.80.0120.00619.39
7.4.70.0080.01216.63
7.4.60.0080.00816.37
7.4.50.0090.00916.60
7.4.40.0100.00716.77
7.4.30.0060.01216.60
7.4.00.0000.01414.75
7.3.330.0000.00513.30
7.3.320.0000.00513.45
7.3.310.0040.00416.53
7.3.300.0030.00316.41
7.3.290.0070.00016.44
7.3.280.0080.00816.43
7.3.270.0120.00617.40
7.3.260.0090.00816.62
7.3.250.0110.00816.45
7.3.240.0100.00716.47
7.3.230.0080.00816.63
7.3.210.0200.03616.56
7.3.200.0090.00916.63
7.3.190.0040.01416.55
7.3.180.0170.00016.59
7.3.170.0060.01016.52
7.3.160.0150.00616.47
7.2.330.0100.00716.80
7.2.320.0060.00916.50
7.2.310.0070.01716.52
7.2.300.0100.00716.56
7.2.290.0080.01016.50
7.2.90.0470.00614.73
7.2.80.0240.00314.81
7.2.70.0300.01015.02
7.2.60.0190.00114.84
7.2.50.1660.01315.00
7.2.40.0420.01014.90
7.2.30.0450.01015.30
7.2.20.0550.00315.21
7.2.10.0440.01015.13
7.2.00.0460.01014.80
7.1.210.0460.00713.86
7.1.200.0250.01113.84
7.1.190.0100.00713.87
7.1.180.0490.00414.07
7.1.170.0620.00614.11
7.1.160.0400.00713.86
7.1.150.0430.01013.99
7.1.140.0500.01214.05
7.1.130.0270.00713.96
7.1.120.0610.00314.10
7.1.110.0480.01013.69
7.1.100.0090.00913.91
7.1.90.1210.00613.87
7.1.80.1030.00313.88
7.1.70.0170.01013.78
7.1.60.0470.01031.98
7.1.50.0760.00431.90
7.1.40.0830.00331.92
7.1.30.0950.01331.93
7.1.20.0900.00631.92
7.1.10.0050.01513.83
7.1.00.0140.01113.84
7.0.310.0120.00313.47
7.0.300.0560.00313.56
7.0.290.0420.00713.51
7.0.280.0370.00613.68
7.0.270.0560.01113.41
7.0.260.0750.01013.45
7.0.250.0100.00613.74
7.0.240.0680.00913.63
7.0.230.0310.00313.63
7.0.220.0130.00513.50
7.0.210.0160.00513.49
7.0.200.0100.01013.66
7.0.190.0130.00713.52
7.0.180.0200.00613.50
7.0.170.0090.00913.63
7.0.160.0130.00813.58
7.0.150.0110.01013.64
7.0.140.0090.00313.52
7.0.130.1000.00613.68
7.0.120.0100.00713.69
7.0.110.0110.00713.52
7.0.100.0590.00913.68
7.0.90.1020.00713.75
7.0.80.1020.00613.46
7.0.70.0760.00913.71
7.0.60.0810.00613.57
7.0.50.0710.01213.51
7.0.40.1200.00913.69
7.0.30.0870.00713.51
7.0.20.0720.00313.34
7.0.10.0060.01213.28
7.0.00.0070.01013.34

preferences:
30.78 ms | 401 KiB | 5 Q