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(); return $this; } } public function __construct() { $this->data = ['foo' => 'test', 'body' => 'content']; } public function test() { $function = debug_backtrace()[1]['function']; $getCalled = get_called_class(); $a = new $getCalled(); $a->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.0110.00416.88
8.3.50.0150.00316.18
8.3.40.0160.00018.89
8.3.30.0080.00818.60
8.3.20.0040.00420.16
8.3.10.0040.00423.65
8.3.00.0070.00417.59
8.2.180.0070.01418.24
8.2.170.0040.01122.96
8.2.160.0140.00020.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00421.18
8.2.120.0000.00826.35
8.2.110.0030.00622.25
8.2.100.0040.00817.85
8.2.90.0060.00319.21
8.2.80.0040.00418.04
8.2.70.0030.00717.63
8.2.60.0030.00517.80
8.2.50.0000.00818.10
8.2.40.0040.00420.50
8.2.30.0030.00621.11
8.2.20.0040.00418.18
8.2.10.0000.00718.18
8.2.00.0060.00318.13
8.1.270.0030.00623.96
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0080.00023.98
8.1.230.0050.00917.89
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0050.00517.35
8.1.190.0060.00317.22
8.1.180.0060.00318.10
8.1.170.0040.00418.49
8.1.160.0040.00419.04
8.1.150.0000.00820.61
8.1.140.0000.00719.45
8.1.130.0000.00818.72
8.1.120.0070.00017.29
8.1.110.0000.00817.36
8.1.100.0050.00317.45
8.1.90.0000.00717.45
8.1.80.0040.00417.37
8.1.70.0040.00417.31
8.1.60.0030.00517.53
8.1.50.0040.00417.55
8.1.40.0040.00417.59
8.1.30.0030.00517.67
8.1.20.0000.00717.59
8.1.10.0030.00717.57
8.1.00.0040.00417.54
8.0.300.0060.00618.77
8.0.290.0050.00216.63
8.0.280.0000.00718.32
8.0.270.0030.00417.28
8.0.260.0030.00316.80
8.0.250.0060.00016.88
8.0.240.0050.00316.88
8.0.230.0060.00316.84
8.0.220.0000.00716.74
8.0.210.0050.00216.86
8.0.200.0000.00616.80
8.0.190.0030.00716.93
8.0.180.0040.00416.86
8.0.170.0030.00316.90
8.0.160.0000.00816.81
8.0.150.0040.00416.85
8.0.140.0040.00416.67
8.0.130.0000.00513.27
8.0.120.0000.00716.78
8.0.110.0000.00816.82
8.0.100.0040.00416.80
8.0.90.0040.00416.83
8.0.80.0060.00916.87
8.0.70.0030.00516.63
8.0.60.0040.00416.91
8.0.50.0040.00416.80
8.0.30.0120.00316.99
8.0.20.0080.01117.40
8.0.10.0000.00816.86
8.0.00.0060.01216.46
7.4.330.0020.00215.55
7.4.320.0070.00016.50
7.4.300.0000.00616.53
7.4.290.0000.00816.52
7.4.280.0050.00316.63
7.4.270.0030.00316.61
7.4.260.0000.00513.30
7.4.250.0030.00616.45
7.4.240.0070.00016.53
7.4.230.0030.00316.61
7.4.220.0090.01016.41
7.4.210.0060.00916.50
7.4.200.0000.00816.36
7.4.160.0090.00916.51
7.4.150.0130.00917.40
7.4.140.0070.01517.86
7.4.130.0130.00616.32
7.4.120.0060.01216.51
7.4.110.0060.01016.50
7.4.100.0150.00616.51
7.4.90.0090.00916.43
7.4.80.0070.01119.39
7.4.70.0110.00516.58
7.4.60.0130.00316.41
7.4.50.0070.00716.60
7.4.40.0040.01316.50
7.4.30.0070.01016.66
7.4.00.0000.01514.64
7.3.330.0000.00613.23
7.3.320.0000.00613.18
7.3.310.0030.00316.47
7.3.300.0030.00316.36
7.3.290.0030.00316.29
7.3.280.0080.00816.36
7.3.270.0000.01717.40
7.3.260.0110.00616.53
7.3.250.0090.00916.45
7.3.240.0050.01316.31
7.3.230.0150.00316.40
7.3.210.0130.00316.40
7.3.200.0070.01416.30
7.3.190.0080.00816.44
7.3.180.0100.00616.25
7.3.170.0060.01616.41
7.3.160.0030.01316.34
7.2.330.0060.01116.40
7.2.320.0100.00716.70
7.2.310.0000.01616.64
7.2.300.0120.00916.37
7.2.290.0040.01816.76
7.2.90.0290.00014.55
7.2.80.0580.01014.88
7.2.70.0400.00615.15
7.2.60.0830.00714.99
7.2.50.0450.00314.94
7.2.40.0610.00615.11
7.2.30.0970.00315.18
7.2.20.0180.00915.01
7.2.10.0440.00015.00
7.2.00.0340.00014.83
7.1.210.0420.00613.64
7.1.200.0460.00314.00
7.1.190.0550.00914.11
7.1.180.0500.00713.81
7.1.170.0560.01013.95
7.1.160.0170.00713.75
7.1.150.0500.00013.98
7.1.140.0460.00314.09
7.1.130.0190.00514.00
7.1.120.0420.00813.90
7.1.110.0210.00914.05
7.1.100.0480.00013.82
7.1.90.0290.00713.88
7.1.80.0590.00713.55
7.1.70.0280.01013.84
7.1.60.0290.00731.86
7.1.50.0660.00331.86
7.1.40.0390.00832.18
7.1.30.0750.00731.86
7.1.20.0500.01131.65
7.1.10.0120.00813.94
7.1.00.0370.00713.94
7.0.310.0650.00313.58
7.0.300.0500.01013.34
7.0.290.0310.00913.57
7.0.280.0230.00713.84
7.0.270.0100.00513.68
7.0.260.0350.00013.64
7.0.250.0450.00313.66
7.0.240.0660.00313.44
7.0.230.0330.01013.71
7.0.220.0600.00313.45
7.0.210.0370.00613.79
7.0.200.0500.00013.64
7.0.190.0440.01013.70
7.0.180.0460.01213.44
7.0.170.0790.00613.34
7.0.160.0400.00313.66
7.0.150.0500.00313.61
7.0.140.0260.00313.81
7.0.130.0500.00913.72
7.0.120.0300.00913.72
7.0.110.0260.00013.48
7.0.100.0210.00713.48
7.0.90.0240.00313.51
7.0.80.0240.01013.22
7.0.70.0300.01013.33
7.0.60.1150.00313.57
7.0.50.0810.00713.76
7.0.40.0660.00313.82
7.0.30.0570.00313.55
7.0.20.0170.00313.59
7.0.10.0410.00613.61
7.0.00.0000.01413.63

preferences:
52.87 ms | 400 KiB | 5 Q