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']; $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.0120.00918.43
8.3.50.0140.00316.48
8.3.40.0040.01118.97
8.3.30.0000.01418.75
8.3.20.0040.00420.38
8.3.10.0040.00421.72
8.3.00.0030.00617.59
8.2.180.0110.00718.45
8.2.170.0090.00622.96
8.2.160.0070.00720.18
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0080.00020.99
8.2.120.0080.00026.35
8.2.110.0040.00419.30
8.2.100.0080.00417.78
8.2.90.0090.00318.95
8.2.80.0030.00518.04
8.2.70.0080.00317.50
8.2.60.0040.00417.93
8.2.50.0030.00619.63
8.2.40.0050.00320.50
8.2.30.0040.00421.14
8.2.20.0080.00018.20
8.2.10.0000.00718.14
8.2.00.0040.00418.16
8.1.280.0100.00725.92
8.1.270.0070.00023.96
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0090.00022.19
8.1.230.0110.00017.83
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0030.00517.22
8.1.180.0080.00018.10
8.1.170.0000.00818.46
8.1.160.0030.00519.08
8.1.150.0040.00420.54
8.1.140.0080.00019.54
8.1.130.0030.00318.87
8.1.120.0040.00417.35
8.1.110.0040.00417.42
8.1.100.0040.00417.32
8.1.90.0000.00717.44
8.1.80.0000.00717.41
8.1.70.0000.00817.49
8.1.60.0060.00317.59
8.1.50.0070.00017.58
8.1.40.0040.00417.43
8.1.30.0040.00417.66
8.1.20.0140.00017.72
8.1.10.0040.00417.64
8.1.00.0050.00317.51
8.0.300.0120.00018.77
8.0.290.0040.00416.58
8.0.280.0000.00718.48
8.0.270.0030.00317.27
8.0.260.0070.00016.84
8.0.250.0070.00016.99
8.0.240.0050.00216.93
8.0.230.0000.00716.91
8.0.220.0000.00616.84
8.0.210.0040.00416.87
8.0.200.0070.00016.93
8.0.190.0000.01016.94
8.0.180.0040.00416.93
8.0.170.0040.00416.78
8.0.160.0000.00716.93
8.0.150.0000.00716.81
8.0.140.0050.00216.82
8.0.130.0000.00713.25
8.0.120.0000.00816.83
8.0.110.0000.00716.84
8.0.100.0050.00216.84
8.0.90.0000.00716.82
8.0.80.0120.01116.84
8.0.70.0040.00416.90
8.0.60.0000.00716.66
8.0.50.0040.00416.84
8.0.30.0070.01217.11
8.0.20.0100.01017.40
8.0.10.0000.00716.93
8.0.00.0070.01116.84
7.4.330.0030.00315.55
7.4.320.0070.00016.59
7.4.300.0000.00616.53
7.4.290.0080.00316.43
7.4.280.0070.00016.54
7.4.270.0070.00016.54
7.4.260.0050.00013.31
7.4.250.0000.00716.55
7.4.240.0070.00016.53
7.4.230.0030.00316.65
7.4.220.0120.00916.41
7.4.210.0110.00716.53
7.4.200.0050.00316.48
7.4.160.0090.00916.55
7.4.150.0130.00417.40
7.4.140.0100.00817.86
7.4.130.0150.00316.68
7.4.120.0090.00816.50
7.4.110.0120.00616.56
7.4.100.0160.00916.54
7.4.90.0130.00316.58
7.4.80.0100.00719.39
7.4.70.0070.01116.27
7.4.60.0120.00416.49
7.4.50.0120.00316.57
7.4.40.0070.01016.39
7.4.30.0070.01716.61
7.4.00.0100.00715.17
7.3.330.0000.00613.24
7.3.320.0030.00313.21
7.3.310.0000.00716.27
7.3.300.0000.00716.23
7.3.290.0000.00716.38
7.3.280.0090.00816.37
7.3.270.0120.00417.40
7.3.260.0100.00716.39
7.3.250.0140.00416.39
7.3.240.0090.00716.43
7.3.230.0150.00716.51
7.3.210.0100.00716.25
7.3.200.0000.01716.71
7.3.190.0060.01016.33
7.3.180.0130.00316.65
7.3.170.0090.00616.70
7.3.160.0040.01816.25
7.3.120.0110.00614.91
7.3.110.0070.01115.12
7.3.100.0070.00714.93
7.3.90.0080.00615.18
7.3.80.0080.00715.20
7.3.70.0050.00815.02
7.3.60.0100.00515.09
7.3.50.0050.00515.09
7.3.40.0110.00315.02
7.3.30.0080.00415.08
7.3.20.0080.00416.71
7.3.10.0070.00716.61
7.3.00.0050.00516.65
7.2.330.0090.01216.37
7.2.320.0100.00716.84
7.2.310.0030.01416.47
7.2.300.0120.00916.90
7.2.290.0110.00516.84
7.2.250.0070.01115.29
7.2.240.0090.01115.19
7.2.230.0130.00415.16
7.2.220.0030.00815.20
7.2.210.0050.01115.19
7.2.200.0060.01115.18
7.2.190.0050.00715.17
7.2.180.0050.00915.07
7.2.170.0060.00615.23
7.2.90.0260.01214.93
7.2.80.0230.00314.92
7.2.70.0430.00314.79
7.2.60.0420.00015.31
7.2.50.0330.01515.04
7.2.40.0220.00915.20
7.2.30.0330.00715.01
7.2.20.0030.01015.02
7.2.10.0800.00715.24
7.2.00.0420.00614.92
7.1.330.0080.00715.77
7.1.320.0070.00815.68
7.1.310.0060.00615.93
7.1.300.0040.00615.90
7.1.290.0070.00915.78
7.1.280.0040.00815.89
7.1.270.0050.00415.86
7.1.260.0060.00615.98
7.1.210.0340.00413.80
7.1.200.0590.00714.19
7.1.190.0160.00914.06
7.1.180.0390.00013.79
7.1.170.0690.00614.18
7.1.160.0430.00714.01
7.1.150.0280.00914.02
7.1.140.0150.00913.89
7.1.130.0190.00714.03
7.1.120.0850.00314.01
7.1.110.0600.00614.22
7.1.100.0510.00614.18
7.1.90.0250.00813.93
7.1.80.0560.01213.80
7.1.70.0500.01013.80
7.1.60.0500.01031.86
7.1.50.0630.00731.75
7.1.40.0970.01332.03
7.1.30.0830.01731.93
7.1.20.0980.00731.57
7.1.10.0340.00913.93
7.1.00.0590.00613.59
7.0.310.0260.00313.53
7.0.300.0190.00513.39
7.0.290.0490.00313.80
7.0.280.0100.00713.46
7.0.270.0170.01713.49
7.0.260.1120.00013.66
7.0.250.0580.00813.67
7.0.240.0480.00713.71
7.0.230.0200.00713.69
7.0.220.0170.00413.74
7.0.210.0480.00613.63
7.0.200.0460.00713.81
7.0.190.0460.01213.77
7.0.180.0880.00313.52
7.0.170.0550.00313.66
7.0.160.0820.01313.74
7.0.150.0670.00313.57
7.0.140.0400.00813.21
7.0.130.0400.00613.59
7.0.120.1510.00313.52
7.0.110.0650.00013.52
7.0.100.0420.01113.49
7.0.90.0390.00413.72
7.0.80.0780.00913.53
7.0.70.0820.00713.82
7.0.60.0400.00313.33
7.0.50.0520.00613.90
7.0.40.0170.00013.53
7.0.30.0170.00413.67
7.0.20.0170.00713.45
7.0.10.0130.00613.41
7.0.00.0430.01113.50

preferences:
42.25 ms | 401 KiB | 5 Q