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() { $function = debug_backtrace()[1]['function']; echo $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.0030.01218.43
8.3.50.0120.00316.46
8.3.40.0150.00018.81
8.3.30.0090.00618.84
8.3.20.0050.00320.21
8.3.10.0030.00621.74
8.3.00.0100.00017.91
8.2.180.0210.00018.07
8.2.170.0090.00622.96
8.2.160.0090.00920.24
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00721.03
8.2.120.0050.00326.35
8.2.110.0120.00620.47
8.2.100.0070.00417.90
8.2.90.0070.00319.40
8.2.80.0080.00018.05
8.2.70.0100.00017.50
8.2.60.0000.00818.03
8.2.50.0040.00418.10
8.2.40.0060.00320.55
8.2.30.0000.00821.17
8.2.20.0040.00418.21
8.2.10.0020.00518.09
8.2.00.0000.00718.00
8.1.280.0140.00325.92
8.1.270.0040.00423.85
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.98
8.1.230.0080.00317.83
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0030.00518.55
8.1.160.0000.00719.01
8.1.150.0020.00520.48
8.1.140.0070.00019.48
8.1.130.0030.00318.86
8.1.120.0060.00317.41
8.1.110.0090.00017.31
8.1.100.0000.00717.32
8.1.90.0080.00017.39
8.1.80.0030.00317.46
8.1.70.0000.00717.41
8.1.60.0040.00417.59
8.1.50.0060.00317.55
8.1.40.0000.00917.44
8.1.30.0060.00317.70
8.1.20.0030.00917.66
8.1.10.0040.00417.64
8.1.00.0080.00017.39
8.0.300.0060.00318.77
8.0.290.0000.00716.75
8.0.280.0000.00718.46
8.0.270.0030.00317.16
8.0.260.0050.00316.73
8.0.250.0030.00317.01
8.0.240.0000.00716.88
8.0.230.0040.00416.91
8.0.220.0080.00016.75
8.0.210.0000.00716.79
8.0.200.0030.00316.89
8.0.190.0050.00516.80
8.0.180.0000.00716.87
8.0.170.0000.00716.73
8.0.160.0040.00416.96
8.0.150.0030.00516.73
8.0.140.0040.00416.78
8.0.130.0060.00013.30
8.0.120.0040.00416.71
8.0.110.0040.00416.90
8.0.100.0000.00816.88
8.0.90.0050.00216.70
8.0.80.0060.01216.88
8.0.70.0020.00516.81
8.0.60.0040.00416.68
8.0.50.0050.00216.67
8.0.30.0060.01117.24
8.0.20.0150.01017.40
8.0.10.0030.00516.94
8.0.00.0100.01316.58
7.4.330.0020.00215.55
7.4.320.0070.00016.54
7.4.300.0030.00316.62
7.4.290.0030.00716.57
7.4.280.0080.00016.53
7.4.270.0070.00016.52
7.4.260.0050.00013.30
7.4.250.0000.00716.48
7.4.240.0000.00716.64
7.4.230.0050.00216.61
7.4.220.0130.00616.68
7.4.210.0080.01016.68
7.4.200.0050.00216.52
7.4.160.0050.01216.50
7.4.150.0090.00917.40
7.4.140.0090.01217.86
7.4.130.0100.01416.48
7.4.120.0100.00916.54
7.4.110.0140.00316.38
7.4.100.0130.00916.47
7.4.90.0090.00916.54
7.4.80.0150.00919.39
7.4.70.0120.00616.40
7.4.60.0080.00816.63
7.4.50.0060.01016.42
7.4.40.0170.00016.66
7.4.30.0050.01116.68
7.4.00.0030.01514.89
7.3.330.0050.00013.16
7.3.320.0030.00313.37
7.3.310.0040.00416.42
7.3.300.0070.00016.27
7.3.290.0030.00316.38
7.3.280.0070.00916.35
7.3.270.0070.01017.40
7.3.260.0100.00716.37
7.3.250.0080.00916.40
7.3.240.0120.00716.63
7.3.230.0060.01316.41
7.3.210.0070.01016.38
7.3.200.0070.01116.66
7.3.190.0060.01016.30
7.3.180.0090.00616.64
7.3.170.0100.00516.39
7.3.160.0100.01016.54
7.3.120.0070.01114.72
7.3.110.0070.01114.93
7.3.100.0100.00714.70
7.3.90.0080.00814.74
7.3.80.0060.00614.93
7.3.70.0030.00715.00
7.3.60.0070.00714.61
7.3.50.0040.00714.82
7.3.40.0100.00014.54
7.3.30.0040.00714.95
7.3.20.0040.00416.64
7.3.10.0070.00816.69
7.3.00.0080.00716.82
7.2.330.0040.01616.83
7.2.320.0090.01316.86
7.2.310.0100.00716.83
7.2.300.0130.00616.73
7.2.290.0120.00616.83
7.2.250.0070.01315.07
7.2.240.0070.01415.09
7.2.230.0100.00715.21
7.2.220.0040.01115.38
7.2.210.0060.00315.40
7.2.200.0030.00715.36
7.2.190.0060.00914.88
7.2.180.0030.00615.27
7.2.170.0060.00915.08
7.2.130.0050.01016.88
7.2.120.0050.01016.88
7.2.110.0020.01116.88
7.2.100.0090.00516.84
7.2.90.0270.00916.23
7.2.80.0150.00616.23
7.2.70.0060.00916.20
7.2.60.0190.00516.29
7.2.50.0230.00716.32
7.2.40.0190.00516.33
7.2.30.0250.00616.30
7.2.20.0360.00916.29
7.2.10.0210.00816.40
7.2.00.0230.00616.36
7.1.330.0080.00815.96
7.1.320.0030.00915.93
7.1.310.0000.01415.93
7.1.300.0080.00615.88
7.1.290.0030.00715.67
7.1.280.0070.00715.64
7.1.270.0060.00915.99
7.1.260.0030.00615.86
7.1.250.0040.00815.71
7.1.210.0620.00013.98
7.1.200.0340.00913.98
7.1.190.0340.01014.01
7.1.180.0450.00713.80
7.1.170.0500.00314.01
7.1.160.0450.00414.21
7.1.150.0380.00413.79
7.1.140.0460.00714.00
7.1.130.0290.01013.61
7.1.120.0510.00313.99
7.1.110.0430.00914.12
7.1.100.0710.01714.05
7.1.90.0430.00014.03
7.1.80.0390.00714.04
7.1.70.0840.00314.13
7.1.60.0900.00332.11
7.1.50.0520.00931.97
7.1.40.0550.01031.80
7.1.30.0660.00731.71
7.1.20.0250.00731.98
7.1.10.0400.00013.84
7.1.00.0140.00414.13
7.0.310.0100.00613.66
7.0.300.0430.00813.35
7.0.290.0280.01513.63
7.0.280.0640.01313.46
7.0.270.0470.00313.43
7.0.260.0830.00413.61
7.0.250.0420.00713.61
7.0.240.0610.00313.72
7.0.230.0550.00313.63
7.0.220.0310.01213.47
7.0.210.0750.00713.51
7.0.200.0410.00713.77
7.0.190.0530.00313.49
7.0.180.0500.00313.54
7.0.170.0170.00913.56
7.0.160.0460.00313.40
7.0.150.0470.00313.49
7.0.140.0810.00313.59
7.0.130.0420.01013.75
7.0.120.0350.00913.71
7.0.110.0480.00713.50
7.0.100.0470.00313.73
7.0.90.0210.00613.33
7.0.80.0330.01013.70
7.0.70.0370.00613.44
7.0.60.0200.00013.55
7.0.50.0520.00713.53
7.0.40.0440.00313.60
7.0.30.0340.00713.80
7.0.20.0350.01113.46
7.0.10.0380.01113.46
7.0.00.0360.00713.59

preferences:
46.67 ms | 401 KiB | 5 Q