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(); (new $getCalled())->$name(); } } public function __construct() { $this->data = ['foo' => 'test', 'body' => 'content']; } public function test() { $function = debug_backtrace()[1]['function']; echo $function; $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.0100.01016.50
8.3.50.0090.00616.59
8.3.40.0070.01018.92
8.3.30.0110.00418.86
8.3.20.0040.00420.18
8.3.10.0040.00423.65
8.3.00.0070.00317.68
8.2.180.0180.00016.88
8.2.170.0090.00622.96
8.2.160.0100.00320.38
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0080.00020.94
8.2.120.0070.00026.35
8.2.110.0080.00320.53
8.2.100.0100.00317.84
8.2.90.0000.00819.09
8.2.80.0000.00817.97
8.2.70.0030.00517.63
8.2.60.0050.00317.78
8.2.50.0040.00418.16
8.2.40.0050.00322.11
8.2.30.0040.00419.34
8.2.20.0040.00418.16
8.2.10.0000.00718.27
8.2.00.0040.00418.02
8.1.280.0080.01225.92
8.1.270.0080.00023.83
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0080.00319.26
8.1.230.0060.00619.12
8.1.220.0060.00317.74
8.1.210.0060.00318.77
8.1.200.0090.00017.36
8.1.190.0030.00617.22
8.1.180.0040.00418.10
8.1.170.0040.00418.62
8.1.160.0070.00019.01
8.1.150.0040.00418.62
8.1.140.0050.00219.54
8.1.130.0030.00318.80
8.1.120.0040.00417.39
8.1.110.0030.00517.41
8.1.100.0040.00417.45
8.1.90.0040.00417.41
8.1.80.0030.00517.42
8.1.70.0040.00417.38
8.1.60.0000.00917.62
8.1.50.0030.00617.55
8.1.40.0000.00817.59
8.1.30.0070.00017.69
8.1.20.0050.00217.54
8.1.10.0000.00817.54
8.1.00.0030.00517.61
8.0.300.0090.00018.77
8.0.290.0040.00416.63
8.0.280.0000.00718.49
8.0.270.0000.00717.23
8.0.260.0040.00416.73
8.0.250.0030.00316.98
8.0.240.0030.00316.98
8.0.230.0040.00716.84
8.0.220.0040.00416.86
8.0.210.0070.00016.82
8.0.200.0000.00716.79
8.0.190.0030.00716.85
8.0.180.0000.00716.88
8.0.170.0040.00416.77
8.0.160.0050.00216.84
8.0.150.0040.00416.69
8.0.140.0040.00416.82
8.0.130.0000.00613.27
8.0.120.0040.00416.85
8.0.110.0020.00516.77
8.0.100.0050.00216.75
8.0.90.0080.00016.82
8.0.80.0070.01116.83
8.0.70.0080.00016.93
8.0.60.0000.00716.89
8.0.50.0080.00016.78
8.0.30.0070.01317.22
8.0.20.0130.00617.40
8.0.10.0040.00416.97
8.0.00.0120.00616.82
7.4.330.0020.00215.55
7.4.320.0060.00016.61
7.4.300.0060.00016.54
7.4.290.0030.00616.66
7.4.280.0080.00016.57
7.4.270.0030.00316.51
7.4.260.0030.00313.32
7.4.250.0000.00916.60
7.4.240.0000.00716.64
7.4.230.0030.00316.63
7.4.220.0130.00716.34
7.4.210.0020.01216.48
7.4.200.0050.00316.54
7.4.160.0110.00516.48
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0120.00916.62
7.4.120.0100.01016.53
7.4.110.0030.01416.34
7.4.100.0170.00716.68
7.4.90.0100.01016.47
7.4.80.0100.00719.39
7.4.70.0070.01016.46
7.4.60.0030.01316.61
7.4.50.0130.00316.53
7.4.40.0120.00416.55
7.4.30.0070.01016.38
7.4.00.0110.00815.04
7.3.330.0000.00613.32
7.3.320.0050.00013.23
7.3.310.0000.00716.24
7.3.300.0000.00716.38
7.3.290.0000.00616.38
7.3.280.0090.00716.36
7.3.270.0180.00017.40
7.3.260.0130.00616.53
7.3.250.0100.00716.59
7.3.240.0060.01016.45
7.3.230.0030.01416.49
7.3.210.0060.01116.37
7.3.200.0070.01116.38
7.3.190.0120.00416.52
7.3.180.0100.00716.32
7.3.170.0060.01016.45
7.3.160.0060.01116.30
7.3.120.0120.00514.72
7.3.110.0070.01114.79
7.3.100.0060.00814.89
7.3.90.0040.01114.93
7.3.80.0080.00614.90
7.3.70.0080.00714.85
7.3.60.0070.00714.89
7.3.50.0060.00514.99
7.3.40.0060.00714.91
7.3.30.0100.00414.67
7.3.20.0080.00716.77
7.3.10.0070.00716.67
7.3.00.0060.00416.61
7.2.330.0060.01116.82
7.2.320.0080.00916.77
7.2.310.0090.00916.86
7.2.300.0090.00916.88
7.2.290.0070.01016.74
7.2.250.0100.00814.97
7.2.240.0080.00814.88
7.2.230.0090.00714.98
7.2.220.0060.00814.96
7.2.210.0060.00915.20
7.2.200.0050.00815.16
7.2.190.0080.00815.02
7.2.180.0070.00715.15
7.2.170.0040.00715.04
7.2.160.0000.01814.97
7.2.150.0090.00916.90
7.2.140.0060.01217.07
7.2.130.0120.00317.08
7.2.120.0130.00316.73
7.2.110.0000.01616.95
7.2.100.0090.00616.77
7.2.90.0110.00716.79
7.2.80.0250.00816.54
7.2.70.0090.00816.59
7.2.60.0520.00515.71
7.2.50.0490.00716.88
7.2.40.0080.01017.05
7.2.30.0430.01016.91
7.2.20.0100.00416.78
7.2.10.0080.00716.80
7.2.00.0070.00716.86
7.1.330.0090.00615.78
7.1.320.0040.00715.83
7.1.310.0050.00815.83
7.1.300.0060.00715.91
7.1.290.0070.00615.93
7.1.280.0060.00715.84
7.1.270.0020.01015.70
7.1.260.0080.00715.83
7.1.250.0080.00515.82
7.1.210.0060.00615.87
7.1.200.0090.00615.76
7.1.190.0120.00615.63
7.1.180.0110.00515.77
7.1.170.0070.00915.48
7.1.160.0500.00614.08
7.1.150.0120.00715.61
7.1.140.0000.01715.79
7.1.130.0080.00815.76
7.1.120.0110.00715.46
7.1.110.0090.00615.99
7.1.100.0070.00815.72
7.1.90.0470.01015.72
7.1.80.0060.00915.93
7.1.70.0120.00915.88
7.1.60.0360.00633.88
7.1.50.0310.01433.68
7.1.40.0320.00033.58
7.1.30.0270.00833.63
7.1.20.0320.00333.61
7.1.10.0090.00615.95
7.1.00.0110.00315.87
7.0.310.0310.01213.38
7.0.300.0090.00615.12
7.0.290.0080.01415.26
7.0.280.0040.01115.55
7.0.270.0000.01215.20
7.0.260.0600.01215.39
7.0.250.0680.01015.34
7.0.240.0120.00515.16
7.0.230.0430.01113.39
7.0.220.0140.00015.10
7.0.210.0060.01615.32
7.0.200.0110.00715.48
7.0.190.0120.00815.41
7.0.180.0070.01015.34
7.0.170.0170.00015.14
7.0.160.0090.00915.32
7.0.150.0160.00715.36
7.0.140.0150.00415.00
7.0.130.0080.00515.15
7.0.120.0030.02014.93
7.0.110.0070.00914.91
7.0.100.0060.01215.21
7.0.90.0140.00215.34
7.0.80.0040.01415.17
7.0.70.0130.00315.01
7.0.60.0090.00515.35
7.0.50.0130.00414.96
7.0.40.0060.01215.06
7.0.30.0120.00415.28
7.0.20.0070.00715.04
7.0.10.0050.01415.07
7.0.00.0060.00815.21

preferences:
60.4 ms | 401 KiB | 5 Q