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 . PHP_EOL; echo $bar->aa()->aa['a']. PHP_EOL; //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.0070.01016.63
8.3.60.0090.00616.63
8.3.50.0130.00816.52
8.3.40.0040.01118.79
8.3.30.0180.00018.67
8.3.20.0040.00420.07
8.3.10.0080.00021.73
8.3.00.0080.00317.72
8.2.180.0120.00616.75
8.2.170.0120.00322.96
8.2.160.0090.00620.36
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00021.18
8.2.120.0040.00426.35
8.2.110.0070.00321.11
8.2.100.0000.01118.21
8.2.90.0000.00819.19
8.2.80.0050.00318.03
8.2.70.0040.00417.75
8.2.60.0080.00017.93
8.2.50.0040.00418.10
8.2.40.0030.00620.20
8.2.30.0060.00321.11
8.2.20.0000.00818.00
8.2.10.0070.00018.18
8.2.00.0000.00718.00
8.1.280.0150.00325.92
8.1.270.0070.00023.91
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0000.01023.92
8.1.230.0080.00420.61
8.1.220.0000.00917.79
8.1.210.0000.00818.77
8.1.200.0030.00717.47
8.1.190.0090.00017.35
8.1.180.0060.00318.10
8.1.170.0050.00318.49
8.1.160.0040.00419.02
8.1.150.0040.00420.62
8.1.140.0040.00419.64
8.1.130.0000.00718.89
8.1.120.0070.00017.48
8.1.110.0040.00417.45
8.1.100.0030.00517.42
8.1.90.0040.00417.45
8.1.80.0030.00317.54
8.1.70.0000.00817.35
8.1.60.0050.00317.52
8.1.50.0080.00017.53
8.1.40.0040.00417.56
8.1.30.0000.00817.58
8.1.20.0040.00417.70
8.1.10.0030.00517.59
8.1.00.0040.00417.45
8.0.300.0000.00818.77
8.0.290.0030.00616.75
8.0.280.0030.00318.46
8.0.270.0040.00417.33
8.0.260.0040.00416.70
8.0.250.0030.00316.95
8.0.240.0080.00016.98
8.0.230.0000.01016.96
8.0.220.0050.00316.79
8.0.210.0070.00016.81
8.0.200.0000.00617.02
8.0.190.0090.00316.95
8.0.180.0040.00416.91
8.0.170.0070.00016.95
8.0.160.0040.00416.93
8.0.150.0040.00416.80
8.0.140.0040.00416.83
8.0.130.0030.00313.38
8.0.120.0030.00616.77
8.0.110.0000.00716.73
8.0.100.0000.00716.96
8.0.90.0020.00516.88
8.0.80.0060.01316.96
8.0.70.0000.00716.86
8.0.60.0040.00416.77
8.0.50.0050.00316.92
8.0.30.0050.01116.98
8.0.20.0090.01217.40
8.0.10.0000.00716.95
8.0.00.0120.00616.57
7.4.330.0020.00215.55
7.4.320.0030.00316.52
7.4.300.0000.00616.43
7.4.290.0000.00816.53
7.4.280.0000.00716.54
7.4.270.0000.00816.48
7.4.260.0060.00013.21
7.4.250.0030.00616.47
7.4.240.0000.00716.62
7.4.230.0050.00216.64
7.4.220.0120.01516.57
7.4.210.0100.00716.60
7.4.200.0040.00416.36
7.4.160.0100.00516.63
7.4.150.0070.01017.40
7.4.140.0110.00717.86
7.4.130.0040.01416.55
7.4.120.0080.01016.51
7.4.110.0060.01016.41
7.4.100.0100.01316.44
7.4.90.0070.01016.48
7.4.80.0000.01719.39
7.4.70.0080.00916.49
7.4.60.0110.00616.64
7.4.50.0030.01216.56
7.4.40.0100.00716.58
7.4.30.0110.00616.24
7.4.10.0100.00714.80
7.4.00.0070.00815.06
7.3.330.0030.00313.33
7.3.320.0000.00513.38
7.3.310.0000.00716.23
7.3.300.0000.00616.33
7.3.290.0030.00316.27
7.3.280.0090.00716.37
7.3.270.0040.01217.40
7.3.260.0100.00916.51
7.3.250.0100.00916.46
7.3.240.0120.00516.58
7.3.230.0070.01016.32
7.3.210.0100.00716.60
7.3.200.0170.00416.52
7.3.190.0080.01416.46
7.3.180.0060.00916.44
7.3.170.0080.00816.49
7.3.160.0130.00416.63
7.3.130.0000.01514.88
7.3.120.0110.00714.87
7.3.110.0060.01215.10
7.3.100.0060.00615.05
7.3.90.0140.00014.82
7.3.80.0060.00914.84
7.3.70.0030.01315.03
7.3.60.0070.01114.95
7.3.50.0070.00714.80
7.3.40.0080.00314.81
7.3.30.0000.01514.81
7.3.20.0060.00616.62
7.3.10.0040.01116.70
7.3.00.0090.00016.70
7.2.330.0060.01316.80
7.2.320.0070.01016.46
7.2.310.0160.00016.66
7.2.300.0140.00316.79
7.2.290.0110.00616.83
7.2.260.0130.00615.26
7.2.250.0040.01415.22
7.2.240.0060.00614.98
7.2.230.0120.00315.24
7.2.220.0030.00615.29
7.2.210.0100.00615.02
7.2.200.0090.00614.85
7.2.190.0040.00715.03
7.2.180.0090.00314.86
7.2.170.0070.01015.09
7.2.160.0080.00815.16
7.2.150.0080.00816.93
7.2.140.0030.01016.97
7.2.130.0070.01016.88
7.2.120.0030.01516.73
7.2.110.0110.00316.92
7.2.100.0030.01016.97
7.2.90.0460.00715.83
7.2.80.0080.00716.84
7.2.70.0040.01016.82
7.2.60.0050.00716.90
7.2.50.0040.00916.86
7.2.40.0100.00517.04
7.2.30.0030.01116.95
7.2.20.0070.00716.86
7.2.10.0180.01615.97
7.2.00.0030.01116.82
7.1.330.0060.00915.60
7.1.320.0030.00916.05
7.1.310.0080.00815.85
7.1.300.0100.00315.73
7.1.290.0060.00915.94
7.1.280.0060.00615.93
7.1.270.0000.01015.59
7.1.260.0030.00615.87
7.1.250.0040.01215.89
7.1.240.0030.01415.70
7.1.230.0060.00315.79
7.1.220.0000.01315.83
7.1.210.0070.00715.92
7.1.200.0060.00815.68
7.1.190.0120.00415.66
7.1.180.0120.00314.89
7.1.170.0030.00915.64
7.1.160.0030.00815.72
7.1.150.0090.00815.80
7.1.140.0060.00915.85
7.1.130.0090.00614.74
7.1.120.0820.00815.00
7.1.110.0070.00715.98
7.1.100.0100.00315.88
7.1.90.0070.00315.84
7.1.80.0040.00615.86
7.1.70.0080.00715.74
7.1.60.0180.00824.84
7.1.50.0200.00824.78
7.1.40.0160.00624.78
7.1.30.0090.01324.89
7.1.20.0160.00724.79
7.1.10.0010.01215.61
7.1.00.0070.00615.83
7.0.330.0100.00715.38
7.0.320.0040.00915.39
7.0.310.0040.00615.31
7.0.300.0200.00815.42
7.0.290.0030.01115.39
7.0.280.0070.00614.59
7.0.270.0230.00314.33
7.0.260.0120.00515.51
7.0.250.0080.00615.28
7.0.240.0130.00215.43
7.0.230.0050.00515.32
7.0.220.0030.00715.39
7.0.210.0930.00815.30
7.0.200.0030.01015.54
7.0.190.0750.00515.46
7.0.180.0090.00615.38
7.0.170.0090.00615.55
7.0.160.0100.00515.30
7.0.150.0060.01015.30
7.0.140.0070.00715.36
7.0.130.1260.00015.54
7.0.120.0070.00914.51
7.0.110.0080.00515.46
7.0.100.0050.01215.44
7.0.90.0080.00715.35
7.0.80.1480.00615.35
7.0.70.0050.00915.53
7.0.60.1090.00315.33
7.0.50.0050.00615.55
7.0.40.1060.00314.55
7.0.30.0090.00414.52
7.0.20.0070.00514.46
7.0.10.0060.00814.33
7.0.00.0030.00914.53
5.6.400.0000.01214.56
5.6.390.0070.00714.43
5.6.380.0000.01314.66
5.6.370.0100.00014.52
5.6.360.0040.00714.85
5.6.350.0050.00514.48
5.6.340.0090.00614.76
5.6.330.0030.00614.70
5.6.320.0090.00614.41
5.6.310.0040.01114.23
5.6.300.0100.00314.55
5.6.290.0030.01014.47
5.6.280.0030.01214.32
5.6.270.0060.00314.34
5.6.260.0030.00614.32
5.6.250.0090.00614.84
5.6.240.0090.00314.62
5.6.230.0060.00914.72
5.6.220.0090.00914.48
5.6.210.0000.01014.28
5.6.200.0060.00914.32
5.6.190.0110.00314.47
5.6.180.0030.00914.34
5.6.170.0000.00914.34
5.6.160.0030.01014.15
5.6.150.0000.01114.67
5.6.140.0030.00714.47
5.6.130.0080.00014.57
5.6.120.0060.00614.91
5.6.110.0030.00614.45
5.6.100.0030.00614.45
5.6.90.0030.01014.18
5.6.80.0080.00414.66
5.6.70.0040.00414.36
5.6.60.0100.00314.70
5.6.50.0030.00914.27
5.6.40.0080.00514.36
5.6.30.0120.00314.38
5.6.20.0070.00714.27
5.6.10.0040.01114.71
5.6.00.0030.00714.49

preferences:
56.52 ms | 401 KiB | 5 Q