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() { print_r(debug_backtrace()); $function = debug_backtrace()[1]['function']; $this->relations[$function] = ['a' =>'aa', 'b' =>'bb']; return $this; } } 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.0040.01116.75
8.3.50.0140.00016.59
8.3.40.0090.00618.83
8.3.30.0070.00718.68
8.3.20.0040.00420.18
8.3.10.0000.00921.77
8.3.00.0100.00017.66
8.2.180.0150.00318.16
8.2.170.0120.00322.96
8.2.160.0000.01420.44
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0050.00321.13
8.2.120.0080.00026.35
8.2.110.0060.00320.52
8.2.100.0110.00017.84
8.2.90.0000.00819.08
8.2.80.0000.00817.97
8.2.70.0120.00017.63
8.2.60.0040.00417.92
8.2.50.0050.00318.10
8.2.40.0000.00820.49
8.2.30.0040.00420.91
8.2.20.0040.00418.14
8.2.10.0070.00018.09
8.2.00.0070.00018.13
8.1.280.0130.00325.92
8.1.270.0080.00021.96
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00023.84
8.1.230.0080.00417.70
8.1.220.0030.00517.74
8.1.210.0000.00918.77
8.1.200.0030.00617.25
8.1.190.0030.00517.23
8.1.180.0070.00018.10
8.1.170.0040.00418.59
8.1.160.0070.00018.96
8.1.150.0050.00320.56
8.1.140.0000.00719.54
8.1.130.0030.00318.92
8.1.120.0060.00317.29
8.1.110.0040.00417.38
8.1.100.0050.00317.32
8.1.90.0070.00017.41
8.1.80.0050.00217.39
8.1.70.0050.00217.48
8.1.60.0040.00417.63
8.1.50.0050.00317.46
8.1.40.0040.00417.59
8.1.30.0000.00817.57
8.1.20.0060.00617.66
8.1.10.0040.00417.58
8.1.00.0000.00717.54
8.0.300.0040.00418.77
8.0.290.0040.00416.58
8.0.280.0040.00418.46
8.0.270.0000.00717.21
8.0.260.0030.00316.80
8.0.250.0030.00316.89
8.0.240.0070.00016.82
8.0.230.0050.00216.91
8.0.220.0000.00716.74
8.0.210.0000.00716.73
8.0.200.0030.00316.91
8.0.190.0060.00516.92
8.0.180.0000.00816.89
8.0.170.0030.00516.86
8.0.160.0030.00516.85
8.0.150.0020.00516.85
8.0.140.0030.00516.85
8.0.130.0030.00313.30
8.0.120.0000.00716.84
8.0.110.0000.00716.95
8.0.100.0000.00816.85
8.0.90.0040.00416.73
8.0.80.0000.01616.79
8.0.70.0040.00416.72
8.0.60.0070.00016.89
8.0.50.0000.00716.76
8.0.30.0140.00617.24
8.0.20.0110.00917.40
8.0.10.0000.00716.86
8.0.00.0090.00916.92
7.4.330.0030.00315.55
7.4.320.0070.00016.54
7.4.300.0030.00316.42
7.4.290.0070.00316.65
7.4.280.0040.00416.64
7.4.270.0040.00416.58
7.4.260.0000.00513.27
7.4.250.0000.00716.64
7.4.240.0000.00716.63
7.4.230.0040.00416.61
7.4.220.0130.01316.46
7.4.210.0070.00816.60
7.4.200.0050.00316.66
7.4.160.0040.01316.56
7.4.150.0100.01017.40
7.4.140.0120.00717.86
7.4.130.0090.00916.48
7.4.120.0060.01216.51
7.4.110.0080.00916.44
7.4.100.0110.00716.30
7.4.90.0070.01016.43
7.4.80.0070.01119.39
7.4.70.0090.00816.70
7.4.60.0060.01016.57
7.4.50.0000.01216.23
7.4.40.0040.01316.72
7.4.30.0030.01316.34
7.4.00.0100.00714.82
7.3.330.0000.00713.23
7.3.320.0000.00613.44
7.3.310.0080.00016.35
7.3.300.0070.00016.37
7.3.290.0030.00316.23
7.3.280.0070.00916.35
7.3.270.0030.01317.40
7.3.260.0100.00916.40
7.3.250.0110.01016.45
7.3.240.0100.00716.63
7.3.230.0150.00316.54
7.3.210.0070.01116.61
7.3.200.0130.00316.21
7.3.190.0030.01216.34
7.3.180.0100.01016.50
7.3.170.0060.00916.46
7.3.160.0090.01216.38
7.3.120.0080.00814.94
7.3.110.0000.01714.80
7.3.100.0070.00714.88
7.3.90.0090.00315.04
7.3.80.0000.01014.85
7.3.70.0070.00614.81
7.3.60.0030.01314.86
7.3.50.0030.01014.83
7.3.40.0060.00314.72
7.3.30.0090.00315.03
7.3.20.0030.01016.68
7.3.10.0000.01416.55
7.3.00.0050.00916.57
7.2.330.0130.00316.62
7.2.320.0060.01216.57
7.2.310.0080.01216.87
7.2.300.0170.00016.81
7.2.290.0060.01216.63
7.2.240.0110.00714.94
7.2.230.0000.01415.06
7.2.220.0000.01215.11
7.2.210.0000.01414.90
7.2.200.0050.00515.10
7.2.190.0030.01015.25
7.2.180.0070.01115.13
7.2.170.0000.01315.18
7.2.160.0130.00014.94
7.2.150.0060.00317.09
7.2.140.0140.00416.82
7.2.130.0050.00716.75
7.2.120.0060.00716.82
7.2.110.0070.00716.96
7.2.100.0020.01016.94
7.2.90.0080.00716.27
7.2.80.0050.00616.33
7.2.70.0530.00716.30
7.2.60.0580.00816.55
7.2.50.0100.01016.38
7.2.40.0560.00716.28
7.2.30.0350.00616.24
7.2.20.0030.01016.25
7.2.10.0880.00616.49
7.2.00.0590.00716.36
7.1.330.0060.01015.86
7.1.320.0030.00615.86
7.1.310.0000.01015.88
7.1.300.0000.01515.74
7.1.290.0030.00915.76
7.1.280.0040.01115.95
7.1.270.0030.01015.75
7.1.260.0030.01415.93
7.1.250.0040.01015.78
7.1.240.0030.00815.48
7.1.230.0040.00715.79
7.1.220.0070.00715.64
7.1.210.0060.00415.03
7.1.200.0090.00515.13
7.1.190.0100.00815.15
7.1.180.1020.00514.90
7.1.170.0090.00515.06
7.1.160.0840.00615.17
7.1.150.0850.00815.23
7.1.140.1590.00515.15
7.1.130.1000.00715.11
7.1.120.0780.00615.13
7.1.110.0050.00815.03
7.1.100.0440.00415.22
7.1.90.0180.00515.13
7.1.80.0120.00514.98
7.1.70.0250.00515.21
7.1.60.0320.00721.16
7.1.50.0170.00721.06
7.1.40.0140.00821.04
7.1.30.0160.00620.97
7.1.20.0400.00921.03
7.1.10.1270.00915.05
7.1.00.0110.00415.06
7.0.330.0080.00615.45
7.0.320.0070.00415.27
7.0.310.0060.00614.77
7.0.300.0100.00614.57
7.0.290.0980.00614.78
7.0.280.0110.00614.52
7.0.270.1060.01014.66
7.0.260.0830.00414.74
7.0.250.0120.00714.88
7.0.240.0120.00614.83
7.0.230.0740.00714.77
7.0.220.0300.00914.61
7.0.210.0150.00514.89
7.0.200.0120.00414.76
7.0.190.0110.00914.65
7.0.180.0280.00614.70
7.0.170.0100.00814.88
7.0.160.0630.00714.68
7.0.150.0090.00914.80
7.0.140.0210.00714.75
7.0.130.0420.00914.71
7.0.120.0260.00714.70
7.0.110.0090.00814.73
7.0.100.0410.00814.79
7.0.90.0350.01014.75
7.0.80.0310.01014.85
7.0.70.0260.00814.76
7.0.60.0250.00914.77
7.0.50.0260.00914.83
7.0.40.0310.01013.53
7.0.30.0310.00713.56
7.0.20.0340.01013.34
7.0.10.0390.00513.64
7.0.00.0490.00713.46
5.6.380.0090.00514.44

preferences:
48.75 ms | 400 KiB | 5 Q