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.40.0090.00618.68
8.3.30.0120.00318.67
8.3.20.0040.00420.20
8.3.10.0040.00421.84
8.3.00.0030.00619.54
8.2.170.0120.00322.96
8.2.160.0090.00620.52
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00421.12
8.2.120.0040.00426.35
8.2.110.0060.00321.00
8.2.100.0070.00418.22
8.2.90.0050.00319.22
8.2.80.0080.00018.05
8.2.70.0040.00417.75
8.2.60.0050.00317.93
8.2.50.0030.00618.10
8.2.40.0040.00420.40
8.2.30.0000.00821.11
8.2.20.0050.00217.98
8.2.10.0070.00018.04
8.2.00.0080.00018.14
8.1.270.0070.00023.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0080.00420.49
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0040.00717.23
8.1.190.0060.00317.35
8.1.180.0060.00318.10
8.1.170.0030.00618.51
8.1.160.0040.00418.93
8.1.150.0000.00820.61
8.1.140.0000.00719.54
8.1.130.0000.00718.84
8.1.120.0080.00017.30
8.1.110.0000.00717.41
8.1.100.0080.00017.39
8.1.90.0040.00417.34
8.1.80.0030.00317.39
8.1.70.0080.00017.43
8.1.60.0080.00017.58
8.1.50.0000.00717.56
8.1.40.0040.00417.46
8.1.30.0000.00817.56
8.1.20.0040.00417.62
8.1.10.0060.00317.63
8.1.00.0040.00417.45
8.0.300.0040.00418.77
8.0.290.0050.00516.63
8.0.280.0000.00718.50
8.0.270.0000.00717.31
8.0.260.0000.00716.74
8.0.250.0030.00316.84
8.0.240.0040.00416.99
8.0.230.0050.00316.80
8.0.220.0020.00516.84
8.0.210.0000.00716.86
8.0.200.0000.00716.86
8.0.190.0040.00716.82
8.0.180.0050.00216.89
8.0.170.0000.00816.77
8.0.160.0040.00416.88
8.0.150.0000.00716.82
8.0.140.0040.00416.75
8.0.130.0000.00613.19
8.0.120.0070.00016.80
8.0.110.0000.00716.87
8.0.100.0040.00416.68
8.0.90.0000.00716.72
8.0.80.0140.00316.82
8.0.70.0000.00716.79
8.0.60.0000.00816.90
8.0.50.0000.00816.82
8.0.30.0020.01317.39
8.0.20.0170.01117.40
8.0.10.0050.00316.85
8.0.00.0090.00916.77
7.4.330.0050.00015.55
7.4.320.0000.00616.65
7.4.300.0000.00716.36
7.4.290.0090.00016.63
7.4.280.0080.00016.41
7.4.270.0070.00016.59
7.4.260.0030.00313.30
7.4.250.0070.00016.53
7.4.240.0000.00716.44
7.4.230.0030.00316.36
7.4.220.0090.00916.60
7.4.210.0020.01216.62
7.4.200.0000.00716.61
7.4.160.0060.01116.54
7.4.150.0120.00517.40
7.4.140.0130.00717.86
7.4.130.0150.00416.32
7.4.120.0080.01016.52
7.4.110.0160.00316.44
7.4.100.0070.01016.54
7.4.90.0100.01316.46
7.4.80.0130.00919.39
7.4.70.0090.00916.58
7.4.60.0140.00316.57
7.4.50.0070.01016.62
7.4.40.0050.01116.48
7.4.30.0030.01416.64
7.4.10.0070.00814.95
7.4.00.0090.00914.99
7.3.330.0000.00513.40
7.3.320.0030.00313.34
7.3.310.0030.00616.34
7.3.300.0030.00316.37
7.3.290.0030.00316.39
7.3.280.0100.00716.34
7.3.270.0100.00717.40
7.3.260.0090.00916.54
7.3.250.0120.00616.56
7.3.240.0100.00616.38
7.3.230.0110.00716.45
7.3.210.0160.00016.45
7.3.200.0100.01016.50
7.3.190.0120.00916.44
7.3.180.0030.01216.45
7.3.170.0100.00616.33
7.3.160.0100.00716.39
7.3.130.0090.01014.70
7.3.120.0090.00914.98
7.3.110.0100.00814.87
7.3.100.0090.00514.86
7.3.90.0060.00614.64
7.3.80.0060.00514.90
7.3.70.0020.01014.83
7.3.60.0040.00614.95
7.3.50.0050.01014.76
7.3.40.0060.00914.71
7.3.30.0090.00514.61
7.3.20.0070.00316.70
7.3.10.0080.00716.55
7.3.00.0030.00916.64
7.2.330.0180.00016.53
7.2.320.0120.00616.44
7.2.310.0110.01116.79
7.2.300.0100.00716.83
7.2.290.0030.01316.81
7.2.260.0050.01315.03
7.2.250.0140.00315.10
7.2.240.0100.00514.93
7.2.230.0050.01214.98
7.2.220.0070.00515.08
7.2.210.0060.00414.87
7.2.200.0030.01215.08
7.2.190.0090.00515.13
7.2.180.0120.00315.01
7.2.170.0080.00314.94
7.2.160.0060.00814.92
7.2.150.0050.01116.80
7.2.140.0070.00916.80
7.2.130.0040.00716.99
7.2.120.0020.01316.91
7.2.110.0070.00716.74
7.2.100.0060.00716.83
7.2.90.0120.00616.18
7.2.80.0610.00816.23
7.2.70.0100.01016.42
7.2.60.0070.00916.43
7.2.50.0070.00716.33
7.2.40.0070.01016.36
7.2.30.0570.00816.66
7.2.20.0480.01116.42
7.2.10.0060.01016.49
7.2.00.0190.00816.45
7.1.330.0020.01215.93
7.1.320.0050.00915.57
7.1.310.0030.00915.60
7.1.300.0050.00715.68
7.1.290.0060.00615.77
7.1.280.0050.00615.85
7.1.270.0050.00615.84
7.1.260.0050.00615.99
7.1.250.0070.00615.74
7.1.240.0090.00615.71
7.1.230.0070.00715.67
7.1.220.0040.00915.63
7.1.210.0110.00515.13
7.1.200.0830.00515.24
7.1.190.0140.01115.07
7.1.180.0160.00315.29
7.1.170.0060.00715.12
7.1.160.0150.00915.23
7.1.150.0720.00715.08
7.1.140.0480.00615.20
7.1.130.0070.00815.25
7.1.120.0100.00415.24
7.1.110.0490.00415.15
7.1.100.0690.01315.33
7.1.90.0110.00715.17
7.1.80.0620.00915.01
7.1.70.0430.00415.18
7.1.60.0450.00921.19
7.1.50.0310.00721.22
7.1.40.0720.01021.18
7.1.30.0430.00721.12
7.1.20.0280.00821.14
7.1.10.0360.00315.14
7.1.00.0070.00415.00
7.0.330.0030.01015.36
7.0.320.0030.00815.43
7.0.310.0900.00514.86
7.0.300.0110.00614.91
7.0.290.0760.00814.62
7.0.280.0600.00814.61
7.0.270.0040.01014.83
7.0.260.0390.00514.73
7.0.250.0690.00714.86
7.0.240.0620.00714.67
7.0.230.0080.01014.83
7.0.220.0060.01114.93
7.0.210.0430.00914.66
7.0.200.0560.00514.90
7.0.190.0260.01014.77
7.0.180.0180.01114.79
7.0.170.0060.00814.72
7.0.160.0300.00914.79
7.0.150.0050.00914.83
7.0.140.0330.00714.87
7.0.130.0170.00714.79
7.0.120.0250.00814.88
7.0.110.0070.00614.92
7.0.100.0410.00414.90
7.0.90.0200.00414.83
7.0.80.0100.00814.85
7.0.70.0270.00914.80
7.0.60.0040.00814.70
7.0.50.0430.00214.92
7.0.40.0430.00813.37
7.0.30.0430.00613.62
7.0.20.0460.00713.52
7.0.10.0370.00913.44
7.0.00.0100.00413.51
5.6.400.0030.00914.16
5.6.390.0100.00514.54
5.6.380.0060.00314.32
5.6.370.0050.01014.63
5.6.360.0060.00814.61
5.6.350.0020.01314.57
5.6.340.0030.01214.56
5.6.330.0030.01014.24
5.6.320.0090.00314.63
5.6.310.0050.01114.21
5.6.300.0100.00214.49
5.6.290.0030.00914.65
5.6.280.0060.00814.48
5.6.270.0000.01214.52
5.6.260.0040.00914.38
5.6.250.0070.00614.49
5.6.240.0070.00714.47
5.6.230.0070.00814.60
5.6.220.0060.00314.34
5.6.210.0050.01114.29
5.6.200.0060.00714.55
5.6.190.0050.00914.57
5.6.180.0070.00714.54
5.6.170.0020.01114.73
5.6.160.0080.00314.20
5.6.150.0060.00614.50
5.6.140.0010.01214.32
5.6.130.0040.01014.38
5.6.120.0030.00814.44
5.6.110.0020.01114.56
5.6.100.0030.01014.38
5.6.90.0080.00414.52
5.6.80.0060.00614.34
5.6.70.0050.00914.37
5.6.60.0060.00614.41
5.6.50.0050.00714.39
5.6.40.0020.01014.24
5.6.30.0060.00614.43
5.6.20.0030.01014.44
5.6.10.0030.00814.59
5.6.00.0050.00714.37

preferences:
42.34 ms | 400 KiB | 5 Q