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']; 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.0040.01116.75
8.3.50.0040.01116.22
8.3.40.0150.00018.82
8.3.30.0070.00718.84
8.3.20.0070.00020.39
8.3.10.0000.00823.71
8.3.00.0030.00717.51
8.2.180.0140.00318.25
8.2.170.0110.00422.96
8.2.160.0000.01420.47
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00421.00
8.2.120.0040.00426.35
8.2.110.0040.00421.07
8.2.100.0070.00418.16
8.2.90.0100.00018.95
8.2.80.0000.00818.04
8.2.70.0070.00317.63
8.2.60.0080.00017.90
8.2.50.0090.00018.10
8.2.40.0050.00220.47
8.2.30.0050.00321.09
8.2.20.0000.00818.21
8.2.10.0000.00718.02
8.2.00.0050.00318.04
8.1.270.0000.00823.90
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0000.00923.83
8.1.230.0100.00317.51
8.1.220.0080.00017.77
8.1.210.0030.00618.77
8.1.200.0000.00917.25
8.1.190.0080.00017.22
8.1.180.0040.00418.10
8.1.170.0050.00318.53
8.1.160.0050.00219.05
8.1.150.0000.00820.53
8.1.140.0040.00419.54
8.1.130.0030.00318.77
8.1.120.0020.00517.32
8.1.110.0000.00817.30
8.1.100.0040.00417.39
8.1.90.0050.00217.30
8.1.80.0070.00017.39
8.1.70.0040.00417.31
8.1.60.0040.00417.62
8.1.50.0000.00717.43
8.1.40.0000.00817.55
8.1.30.0000.00717.51
8.1.20.0000.00917.55
8.1.10.0000.00917.61
8.1.00.0020.00517.58
8.0.300.0050.00218.77
8.0.290.0080.00016.75
8.0.280.0030.00318.53
8.0.270.0030.00317.34
8.0.260.0000.00716.72
8.0.250.0000.00716.83
8.0.240.0040.00416.88
8.0.230.0040.00716.80
8.0.220.0000.00716.83
8.0.210.0030.00316.88
8.0.200.0030.00316.87
8.0.190.0040.00716.82
8.0.180.0030.00516.87
8.0.170.0070.00016.88
8.0.160.0040.00416.86
8.0.150.0050.00216.75
8.0.140.0000.00716.75
8.0.130.0030.00313.24
8.0.120.0070.00016.70
8.0.110.0050.00216.71
8.0.100.0000.00816.71
8.0.90.0070.00016.64
8.0.80.0060.00916.83
8.0.70.0030.00516.89
8.0.60.0040.00416.85
8.0.50.0040.00416.87
8.0.30.0140.00417.06
8.0.20.0120.00717.40
8.0.10.0000.00816.93
8.0.00.0120.01216.68
7.4.330.0030.00315.55
7.4.320.0030.00316.62
7.4.300.0000.00616.66
7.4.290.0000.01116.50
7.4.280.0020.00516.60
7.4.270.0080.00016.45
7.4.260.0050.00013.36
7.4.250.0000.00716.63
7.4.240.0000.00716.64
7.4.230.0000.00716.29
7.4.220.0100.01616.44
7.4.210.0080.00816.54
7.4.200.0030.00316.73
7.4.160.0120.00416.49
7.4.150.0110.00717.40
7.4.140.0090.01017.86
7.4.130.0120.00616.54
7.4.120.0060.01116.63
7.4.110.0050.01416.64
7.4.100.0160.01016.48
7.4.90.0120.00616.53
7.4.80.0070.01419.39
7.4.70.0070.01016.67
7.4.60.0030.01316.64
7.4.50.0060.01016.51
7.4.40.0000.02016.53
7.4.30.0060.01016.35
7.4.00.0030.01414.86
7.3.330.0000.00513.41
7.3.320.0000.00613.23
7.3.310.0060.00316.39
7.3.300.0000.00616.41
7.3.290.0070.00016.23
7.3.280.0070.01016.31
7.3.270.0130.00317.40
7.3.260.0110.00816.46
7.3.250.0130.00616.45
7.3.240.0090.00916.44
7.3.230.0070.01016.43
7.3.210.0090.00916.63
7.3.200.0090.00616.43
7.3.190.0130.00316.64
7.3.180.0100.00716.45
7.3.170.0090.00616.46
7.3.160.0150.00316.58
7.3.120.0070.01014.77
7.3.110.0080.00814.86
7.3.100.0070.00714.68
7.3.90.0160.00014.83
7.3.80.0060.00914.73
7.3.70.0070.01014.69
7.3.60.0000.01515.00
7.3.50.0000.01514.95
7.3.40.0100.00314.87
7.3.30.0100.00714.43
7.3.20.0030.00816.70
7.3.10.0030.01016.21
7.3.00.0030.01316.63
7.2.330.0060.01116.70
7.2.320.0070.01016.55
7.2.310.0060.01016.48
7.2.300.0100.00616.79
7.2.290.0140.01016.90
7.2.240.0090.00614.88
7.2.230.0100.00715.15
7.2.220.0060.00915.17
7.2.210.0100.00715.17
7.2.200.0040.01515.02
7.2.190.0060.01015.25
7.2.180.0060.01015.13
7.2.170.0000.01115.17
7.2.160.0100.00314.75
7.2.150.0040.01416.84
7.2.140.0070.00716.88
7.2.130.0060.00616.77
7.2.120.0100.00716.90
7.2.110.0060.00616.71
7.2.100.0080.00816.91
7.2.90.0850.00915.78
7.2.80.0030.01015.75
7.2.70.0090.00916.07
7.2.60.0120.00216.07
7.2.50.0990.00515.80
7.2.40.0390.01216.03
7.2.30.0110.00815.82
7.2.20.0760.00815.95
7.2.10.0610.00916.08
7.2.00.0140.00516.02
7.1.330.0060.00615.77
7.1.320.0090.00615.82
7.1.310.0060.00615.90
7.1.300.0070.00715.62
7.1.290.0000.01415.56
7.1.280.0090.00615.66
7.1.270.0000.01415.69
7.1.260.0040.00915.56
7.1.250.0030.01315.65
7.1.210.1090.00914.01
7.1.200.1360.01014.25
7.1.190.1350.00914.01
7.1.180.0100.00713.90
7.1.170.2070.01013.81
7.1.160.0050.01114.03
7.1.150.1110.01013.92
7.1.140.0060.01313.98
7.1.130.0040.01313.70
7.1.120.1220.00014.10
7.1.110.0070.01113.87
7.1.100.0090.00914.21
7.1.90.0790.00613.61
7.1.80.0410.00313.91
7.1.70.0100.00714.15
7.1.60.0330.00732.02
7.1.50.0990.01331.79
7.1.40.0270.01331.72
7.1.30.0230.01331.86
7.1.20.0280.00831.93
7.1.10.0140.00413.88
7.1.00.0060.00614.16
7.0.310.1780.00013.40
7.0.300.0560.00013.54
7.0.290.2350.01013.55
7.0.280.0070.01413.46
7.0.270.0140.00613.48
7.0.260.0060.01213.60
7.0.250.0160.00313.48
7.0.240.0130.00613.59
7.0.230.0130.00013.52
7.0.220.0060.00613.48
7.0.210.0110.00713.55
7.0.200.1170.00613.48
7.0.190.1910.00613.65
7.0.180.0100.00513.34
7.0.170.0160.00613.54
7.0.160.0100.00313.64
7.0.150.0440.00713.51
7.0.140.0100.00613.43
7.0.130.0180.00313.80
7.0.120.0510.00613.64
7.0.110.0040.00913.38
7.0.100.0120.00313.63
7.0.90.1640.00713.45
7.0.80.1760.00313.37
7.0.70.1990.01013.46
7.0.60.1780.00713.61
7.0.50.2720.00613.68
7.0.40.0170.00413.37
7.0.30.0150.00313.59
7.0.20.0440.01113.80
7.0.10.0400.00613.80
7.0.00.1310.01013.34

preferences:
56.53 ms | 400 KiB | 5 Q