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.0040.01416.88
8.3.50.0150.00316.50
8.3.40.0120.00318.59
8.3.30.0120.00418.70
8.3.20.0020.00520.38
8.3.10.0080.00023.48
8.3.00.0030.00719.47
8.2.180.0170.00318.40
8.2.170.0070.00722.96
8.2.160.0060.00820.38
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00421.10
8.2.120.0040.00426.35
8.2.110.0060.00320.49
8.2.100.0000.01117.90
8.2.90.0030.00719.05
8.2.80.0030.00517.97
8.2.70.0080.00317.38
8.2.60.0000.00817.80
8.2.50.0000.00818.10
8.2.40.0000.00720.59
8.2.30.0070.00021.09
8.2.20.0030.00517.97
8.2.10.0040.00418.08
8.2.00.0000.00818.07
8.1.280.0100.00725.92
8.1.270.0040.00423.92
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0100.00024.00
8.1.230.0040.01017.89
8.1.220.0080.00017.77
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0040.00418.71
8.1.160.0000.00719.04
8.1.150.0030.00520.60
8.1.140.0000.00819.54
8.1.130.0030.00318.76
8.1.120.0080.00017.44
8.1.110.0000.00717.41
8.1.100.0000.00817.37
8.1.90.0070.00017.26
8.1.80.0030.00317.29
8.1.70.0000.00817.40
8.1.60.0040.00417.59
8.1.50.0040.00417.56
8.1.40.0000.00817.46
8.1.30.0030.00517.66
8.1.20.0020.00517.61
8.1.10.0100.00017.58
8.1.00.0080.00017.41
8.0.300.0000.00918.77
8.0.290.0060.00316.63
8.0.280.0030.00318.32
8.0.270.0030.00317.21
8.0.260.0060.00016.65
8.0.250.0040.00416.80
8.0.240.0000.00716.95
8.0.230.0000.00816.92
8.0.220.0030.00316.79
8.0.210.0030.00416.84
8.0.200.0060.00016.88
8.0.190.0080.00416.93
8.0.180.0000.00816.84
8.0.170.0000.00716.76
8.0.160.0000.00716.81
8.0.150.0040.00416.82
8.0.140.0050.00316.79
8.0.130.0000.00513.28
8.0.120.0000.00716.73
8.0.110.0040.00316.81
8.0.100.0000.00716.74
8.0.90.0030.00316.72
8.0.80.0030.01216.84
8.0.70.0040.00416.91
8.0.60.0020.00516.83
8.0.50.0050.00316.71
8.0.30.0090.00717.16
8.0.20.0070.01117.40
8.0.10.0000.00816.94
8.0.00.0090.00916.77
7.4.330.0000.00515.55
7.4.320.0000.00716.61
7.4.300.0060.00016.57
7.4.290.0000.00916.55
7.4.280.0000.00716.52
7.4.270.0030.00316.65
7.4.260.0000.00513.25
7.4.250.0040.00416.56
7.4.240.0000.00716.43
7.4.230.0000.00716.37
7.4.220.0130.00916.69
7.4.210.0120.00316.50
7.4.200.0000.00716.44
7.4.160.0080.01116.58
7.4.150.0130.00317.40
7.4.140.0070.01017.86
7.4.130.0190.00316.47
7.4.120.0090.00816.46
7.4.110.0120.00316.45
7.4.100.0120.00616.50
7.4.90.0080.00816.49
7.4.80.0100.01319.39
7.4.70.0070.01016.57
7.4.60.0090.00616.42
7.4.50.0030.01316.37
7.4.40.0100.00716.54
7.4.30.0120.00616.49
7.4.00.0030.01014.89
7.3.330.0000.00513.44
7.3.320.0050.00013.18
7.3.310.0000.00816.36
7.3.300.0040.00416.24
7.3.290.0000.00716.38
7.3.280.0070.01016.35
7.3.270.0160.01317.40
7.3.260.0150.00516.57
7.3.250.0090.01016.47
7.3.240.0100.00816.41
7.3.230.0170.00416.43
7.3.210.0120.00416.48
7.3.200.0030.01216.46
7.3.190.0110.00716.37
7.3.180.0090.00616.59
7.3.170.0080.00816.63
7.3.160.0070.01016.59
7.3.00.0060.00616.47
7.2.330.0120.00616.44
7.2.320.0030.01316.91
7.2.310.0060.01116.87
7.2.300.0030.01516.64
7.2.290.0150.00616.50
7.2.130.0030.01117.04
7.2.120.0000.01816.84
7.2.110.0110.00816.85
7.2.100.0060.00916.66
7.2.90.0040.00916.56
7.2.80.0760.00715.83
7.2.70.1120.00816.05
7.2.60.0110.00416.96
7.2.50.0050.00916.94
7.2.40.0060.00916.91
7.2.30.0040.01116.67
7.2.20.0020.01116.63
7.2.10.0080.00516.80
7.2.00.0960.00716.78
7.1.250.0060.00916.05
7.1.240.0030.00615.62
7.1.230.0030.01215.90
7.1.220.0040.01115.78
7.1.210.0090.00315.67
7.1.200.0970.00915.75
7.1.190.0090.00415.80
7.1.180.0110.00515.63
7.1.170.0100.00715.87
7.1.160.1250.00615.77
7.1.150.0050.00915.66
7.1.140.0060.00815.84
7.1.130.0120.00415.72
7.1.120.0020.01115.50
7.1.110.0050.00615.79
7.1.100.0060.00715.74
7.1.90.0050.00815.76
7.1.80.0050.00715.88
7.1.70.0030.01315.88
7.1.60.0140.01324.75
7.1.50.0140.00824.78
7.1.40.0190.00324.77
7.1.30.0090.01424.84
7.1.20.0190.00624.75
7.1.10.0310.00915.81
7.1.00.0110.00315.82
7.0.330.0000.01615.56
7.0.320.0040.01115.34
7.0.310.0060.00615.32
7.0.300.0050.00615.20
7.0.290.0050.00615.32
7.0.280.0030.00915.48
7.0.270.0070.00615.33
7.0.260.0070.00615.39
7.0.250.0060.00715.33
7.0.240.0090.00215.54
7.0.230.0040.00715.46
7.0.220.0070.00715.24
7.0.210.0110.00215.38
7.0.200.0080.00515.53
7.0.190.0130.00015.20
7.0.180.0060.01115.43
7.0.170.0140.00814.55
7.0.160.0110.00915.44
7.0.150.0080.01014.34
7.0.140.0100.00514.38
7.0.130.0160.00715.51
7.0.120.0490.00514.39
7.0.110.0050.00415.30
7.0.100.0090.00415.40
7.0.90.0080.00715.49
7.0.80.0100.00615.33
7.0.70.0150.00514.55
7.0.60.0080.00615.39
7.0.50.0480.00914.76
7.0.40.0110.00414.60
7.0.30.0070.00914.40
7.0.20.0060.00814.31
7.0.10.0670.00414.32
7.0.00.0050.00814.63
5.6.380.0060.00914.40

preferences:
49.08 ms | 400 KiB | 5 Q