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']; } } 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.70.0040.01118.43
8.3.60.0090.01216.63
8.3.50.0190.01116.54
8.3.40.0110.00418.71
8.3.30.0040.01218.89
8.3.20.0070.00020.32
8.3.10.0030.00623.48
8.3.00.0030.00717.91
8.2.180.0180.00016.75
8.2.170.0060.00922.96
8.2.160.0100.00320.48
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0040.00421.07
8.2.120.0050.00326.35
8.2.110.0030.00720.35
8.2.100.0110.00017.84
8.2.90.0000.00819.22
8.2.80.0050.00318.03
8.2.70.0040.00417.74
8.2.60.0000.00817.93
8.2.50.0050.00318.10
8.2.40.0080.00022.28
8.2.30.0080.00019.45
8.2.20.0070.00018.14
8.2.10.0000.00718.03
8.2.00.0000.00718.03
8.1.280.0060.01025.92
8.1.270.0040.00423.97
8.1.260.0070.00026.35
8.1.250.0090.00028.09
8.1.240.0040.00423.82
8.1.230.0000.01120.97
8.1.220.0030.00517.75
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0030.00517.23
8.1.180.0030.00518.10
8.1.170.0040.00418.62
8.1.160.0000.00719.03
8.1.150.0050.00218.61
8.1.140.0040.00419.50
8.1.130.0000.00718.80
8.1.120.0050.00317.33
8.1.110.0000.00817.46
8.1.100.0040.00417.42
8.1.90.0040.00417.40
8.1.80.0000.00817.48
8.1.70.0020.00517.31
8.1.60.0040.00417.58
8.1.50.0040.00417.48
8.1.40.0090.00017.44
8.1.30.0080.00017.67
8.1.20.0090.00017.62
8.1.10.0080.00017.54
8.1.00.0050.00317.41
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0000.00718.35
8.0.270.0030.00317.34
8.0.260.0030.00316.81
8.0.250.0030.00316.99
8.0.240.0000.00716.93
8.0.230.0030.00716.85
8.0.220.0000.00716.73
8.0.210.0030.00316.79
8.0.200.0070.00016.89
8.0.190.0030.00616.96
8.0.180.0070.00016.86
8.0.170.0050.00216.89
8.0.160.0070.00016.89
8.0.150.0040.00416.82
8.0.140.0000.00716.73
8.0.130.0000.00513.37
8.0.120.0000.00816.81
8.0.110.0050.00316.79
8.0.100.0050.00216.77
8.0.90.0000.00716.77
8.0.80.0130.01016.89
8.0.70.0040.00416.73
8.0.60.0070.00016.91
8.0.50.0050.00316.81
8.0.30.0140.00616.88
8.0.20.0080.01317.43
8.0.10.0040.00416.87
8.0.00.0090.00916.96
7.4.330.0000.00515.55
7.4.320.0000.00616.54
7.4.300.0030.00316.60
7.4.290.0040.00416.68
7.4.280.0040.00516.59
7.4.270.0000.00816.54
7.4.260.0060.00013.29
7.4.250.0030.00316.52
7.4.240.0000.00716.44
7.4.230.0000.00716.71
7.4.220.0090.01216.54
7.4.210.0050.01016.59
7.4.200.0000.00716.57
7.4.160.0060.00916.50
7.4.150.0060.00917.40
7.4.140.0090.01117.86
7.4.130.0110.01116.50
7.4.120.0120.00716.51
7.4.110.0070.01016.61
7.4.100.0100.01316.59
7.4.90.0000.01616.47
7.4.80.0090.01319.39
7.4.70.0060.01016.63
7.4.60.0090.00616.67
7.4.50.0060.00916.35
7.4.40.0030.01316.55
7.4.30.0080.00816.52
7.4.00.0070.00714.93
7.3.330.0000.00613.37
7.3.320.0000.00613.45
7.3.310.0070.00016.41
7.3.300.0030.00316.29
7.3.290.0030.00316.43
7.3.280.0070.01016.36
7.3.270.0110.00717.40
7.3.260.0100.00616.44
7.3.250.0070.01016.43
7.3.240.0070.01016.45
7.3.230.0070.01116.28
7.3.210.0100.00616.50
7.3.200.0080.00816.58
7.3.190.0080.00816.32
7.3.180.0000.01516.64
7.3.170.0120.00316.59
7.3.160.0130.00616.58
7.2.330.0090.01216.40
7.2.320.0070.01016.61
7.2.310.0130.01016.72
7.2.300.0170.00016.75
7.2.290.0100.00716.83
7.2.90.0450.00714.44
7.2.80.0410.00014.86
7.2.70.0340.01014.91
7.2.60.0390.00715.14
7.2.50.0410.00315.29
7.2.40.0340.00315.30
7.2.30.0120.00315.10
7.2.20.0330.00715.05
7.2.10.0410.00415.06
7.2.00.0370.00015.09
7.1.210.0160.00513.80
7.1.200.0350.00413.82
7.1.190.0360.00313.86
7.1.180.0420.00314.18
7.1.170.0460.00613.97
7.1.160.0320.00713.96
7.1.150.0520.00513.93
7.1.140.0650.00614.02
7.1.130.0650.00013.97
7.1.120.0430.00714.20
7.1.110.0390.01313.93
7.1.100.0480.00013.96
7.1.90.0510.00614.09
7.1.80.0450.00413.93
7.1.70.0890.00313.97
7.1.60.0330.00832.05
7.1.50.0570.01031.96
7.1.40.0290.01331.86
7.1.30.0590.01331.59
7.1.20.0250.01031.54
7.1.10.0110.00013.96
7.1.00.0070.00714.11
7.0.310.0360.00713.64
7.0.300.0330.01113.71
7.0.290.0340.00713.32
7.0.280.0280.00613.65
7.0.270.0390.00613.61
7.0.260.0470.01013.51
7.0.250.0410.00613.78
7.0.240.0360.00913.55
7.0.230.0060.00913.50
7.0.220.0030.01313.89
7.0.210.0570.00013.63
7.0.200.0080.00613.53
7.0.190.0060.00613.83
7.0.180.0330.00713.55
7.0.170.0110.00413.79
7.0.160.0090.00613.43
7.0.150.0090.00313.63
7.0.140.0570.00313.48
7.0.130.0750.00313.48
7.0.120.0100.00713.80
7.0.110.0110.00413.63
7.0.100.0630.00413.71
7.0.90.0190.00013.61
7.0.80.0540.00613.64
7.0.70.0150.00313.48
7.0.60.0590.00613.49
7.0.50.0060.01013.82
7.0.40.0070.01013.84
7.0.30.0370.00313.88
7.0.20.0120.00913.68
7.0.10.0620.01013.55
7.0.00.0630.00313.26

preferences:
51.34 ms | 401 KiB | 5 Q