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(); } } 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.0090.00616.75
8.3.50.0180.00316.38
8.3.40.0070.00718.59
8.3.30.0040.01118.51
8.3.20.0070.00020.34
8.3.10.0040.00421.90
8.3.00.0030.00617.90
8.2.180.0110.01118.43
8.2.170.0120.00322.96
8.2.160.0100.00320.48
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0040.00421.12
8.2.120.0040.00426.35
8.2.110.0030.00621.94
8.2.100.0040.00717.90
8.2.90.0040.00818.96
8.2.80.0030.00517.97
8.2.70.0100.00317.50
8.2.60.0030.00517.93
8.2.50.0030.00618.10
8.2.40.0000.00720.61
8.2.30.0040.00421.08
8.2.20.0000.00817.96
8.2.10.0040.00418.17
8.2.00.0040.00417.96
8.1.280.0070.00725.92
8.1.270.0070.00022.19
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00423.97
8.1.230.0120.00017.83
8.1.220.0000.00817.79
8.1.210.0090.00018.77
8.1.200.0060.00317.35
8.1.190.0090.00017.23
8.1.180.0030.00618.10
8.1.170.0040.00418.52
8.1.160.0000.00718.99
8.1.150.0000.00720.61
8.1.140.0040.00419.54
8.1.130.0000.00718.73
8.1.120.0000.00717.41
8.1.110.0080.00017.42
8.1.100.0030.00517.36
8.1.90.0050.00217.46
8.1.80.0000.00717.46
8.1.70.0000.00817.48
8.1.60.0040.00417.66
8.1.50.0080.00017.59
8.1.40.0040.00417.45
8.1.30.0000.00817.57
8.1.20.0120.00017.60
8.1.10.0050.00317.62
8.1.00.0080.00017.61
8.0.300.0060.00618.77
8.0.290.0000.00916.58
8.0.280.0030.00318.42
8.0.270.0070.00017.24
8.0.260.0000.00616.71
8.0.250.0040.00416.92
8.0.240.0080.00016.86
8.0.230.0070.00016.85
8.0.220.0000.00716.80
8.0.210.0000.00716.86
8.0.200.0070.00016.79
8.0.190.0070.00316.94
8.0.180.0040.00416.86
8.0.170.0040.00416.88
8.0.160.0040.00416.81
8.0.150.0050.00316.81
8.0.140.0040.00416.84
8.0.130.0000.00613.27
8.0.120.0040.00416.80
8.0.110.0000.00716.89
8.0.100.0040.00416.84
8.0.90.0000.00716.76
8.0.80.0040.01116.75
8.0.70.0070.00016.92
8.0.60.0040.00416.98
8.0.50.0050.00216.69
8.0.30.0100.00716.91
8.0.20.0090.01017.40
8.0.10.0040.00316.85
8.0.00.0100.00716.80
7.4.330.0020.00215.55
7.4.320.0050.00316.64
7.4.300.0000.00616.62
7.4.290.0030.00716.66
7.4.280.0050.00316.63
7.4.270.0000.00716.67
7.4.260.0060.00013.31
7.4.250.0040.00416.50
7.4.240.0000.00716.66
7.4.230.0000.00716.37
7.4.220.0070.01116.71
7.4.210.0050.01116.55
7.4.200.0040.00416.50
7.4.160.0070.00916.43
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0140.01016.59
7.4.120.0110.00816.64
7.4.110.0060.01016.63
7.4.100.0270.02916.55
7.4.90.0130.00316.56
7.4.80.0100.01019.39
7.4.70.0070.01416.42
7.4.60.0030.01216.52
7.4.50.0040.01416.28
7.4.40.0090.00916.39
7.4.30.0140.00716.64
7.4.00.0030.01414.98
7.3.330.0000.00513.38
7.3.320.0050.00013.18
7.3.310.0040.00416.38
7.3.300.0030.00316.39
7.3.290.0080.00016.39
7.3.280.0070.00916.36
7.3.270.0090.00817.40
7.3.260.0140.01816.48
7.3.250.0110.00916.46
7.3.240.0080.00916.55
7.3.230.0090.00916.44
7.3.210.0060.01016.40
7.3.200.0130.00316.70
7.3.190.0030.01416.49
7.3.180.0120.01216.34
7.3.170.0070.01016.29
7.3.160.0070.01016.51
7.2.330.0100.00716.87
7.2.320.0100.01016.71
7.2.310.0060.01116.78
7.2.300.0100.00616.75
7.2.290.0060.01116.92
7.2.90.0130.01014.53
7.2.80.0550.00914.86
7.2.70.1160.01014.87
7.2.60.1090.01015.03
7.2.50.0120.00615.09
7.2.40.0720.00414.89
7.2.30.0450.01015.17
7.2.20.0550.01315.01
7.2.10.0840.00415.06
7.2.00.0550.01015.33
7.1.210.0600.00613.86
7.1.200.0460.00713.89
7.1.190.0910.01013.94
7.1.180.0420.00613.95
7.1.170.0760.00313.91
7.1.160.0860.00314.01
7.1.150.0500.00613.79
7.1.140.0640.00313.75
7.1.130.0540.00613.86
7.1.120.0130.00713.93
7.1.110.0600.00313.97
7.1.100.0230.00314.02
7.1.90.0950.01013.86
7.1.80.0080.01214.15
7.1.70.0230.00614.07
7.1.60.0710.01032.16
7.1.50.0480.01731.73
7.1.40.0780.00931.77
7.1.30.0220.01131.74
7.1.20.0800.00032.00
7.1.10.0620.00714.13
7.1.00.0540.00414.02
7.0.310.0650.00713.70
7.0.300.0670.00313.63
7.0.290.1780.01013.59
7.0.280.0490.00313.55
7.0.270.0680.00413.79
7.0.260.0120.00313.64
7.0.250.0130.00813.65
7.0.240.0600.00013.82
7.0.230.0710.00313.44
7.0.220.0260.00313.50
7.0.210.0090.00613.23
7.0.200.0590.00713.56
7.0.190.0120.00213.65
7.0.180.0120.00613.83
7.0.170.0710.00713.63
7.0.160.0670.00613.77
7.0.150.0780.00013.63
7.0.140.0980.00313.70
7.0.130.0080.00813.74
7.0.120.0320.00613.61
7.0.110.0120.00313.77
7.0.100.0030.01213.50
7.0.90.0230.00913.74
7.0.80.0160.00513.62
7.0.70.0670.00313.59
7.0.60.0990.00613.66
7.0.50.0220.00613.62
7.0.40.0960.00613.52
7.0.30.1210.01313.82
7.0.20.0160.01013.78
7.0.10.0030.01313.51
7.0.00.0090.00513.56

preferences:
51.35 ms | 401 KiB | 5 Q