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.0070.00716.63
8.3.50.0060.00916.50
8.3.40.0110.00419.01
8.3.30.0120.00418.89
8.3.20.0000.00720.14
8.3.10.0100.00021.73
8.3.00.0110.00017.72
8.2.180.0190.00318.31
8.2.170.0090.00622.96
8.2.160.0070.00720.44
8.2.150.0070.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00421.04
8.2.120.0080.00026.35
8.2.110.0060.00320.40
8.2.100.0090.00317.84
8.2.90.0070.00419.17
8.2.80.0060.00317.97
8.2.70.0090.00317.38
8.2.60.0030.00618.05
8.2.50.0060.00318.10
8.2.40.0040.00420.47
8.2.30.0080.00020.97
8.2.20.0070.00018.07
8.2.10.0070.00018.05
8.2.00.0000.00718.15
8.1.280.0160.00325.92
8.1.270.0040.00422.19
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.67
8.1.230.0080.00320.87
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0060.00317.36
8.1.190.0040.00417.10
8.1.180.0080.00018.10
8.1.170.0050.00318.59
8.1.160.0000.00719.04
8.1.150.0040.00420.48
8.1.140.0040.00419.47
8.1.130.0000.00718.77
8.1.120.0040.00417.46
8.1.110.0040.00417.48
8.1.100.0040.00417.38
8.1.90.0000.00817.31
8.1.80.0030.00317.40
8.1.70.0000.00817.46
8.1.60.0000.00817.51
8.1.50.0000.00717.39
8.1.40.0030.00517.44
8.1.30.0040.00417.73
8.1.20.0080.00417.52
8.1.10.0040.00417.66
8.1.00.0030.00517.48
8.0.300.0080.00018.77
8.0.290.0070.00016.63
8.0.280.0000.00718.52
8.0.270.0000.00717.27
8.0.260.0030.00316.67
8.0.250.0050.00316.88
8.0.240.0040.00416.95
8.0.230.0040.00416.95
8.0.220.0000.00716.91
8.0.210.0000.00716.83
8.0.200.0020.00516.96
8.0.190.0070.00316.92
8.0.180.0000.00716.85
8.0.170.0040.00416.89
8.0.160.0030.00516.94
8.0.150.0000.00716.69
8.0.140.0040.00416.66
8.0.130.0060.00013.27
8.0.120.0040.00416.79
8.0.110.0040.00416.88
8.0.100.0050.00316.82
8.0.90.0040.00416.81
8.0.80.0100.00616.88
8.0.70.0050.00216.79
8.0.60.0040.00416.76
8.0.50.0050.00216.88
8.0.30.0160.00416.80
8.0.20.0110.00917.42
8.0.10.0000.00716.89
8.0.00.0120.00616.87
7.4.330.0000.00515.55
7.4.320.0000.00616.43
7.4.300.0000.00616.52
7.4.290.0000.01016.54
7.4.280.0000.00816.43
7.4.270.0070.00016.59
7.4.260.0030.00313.37
7.4.250.0000.01016.52
7.4.240.0000.00716.54
7.4.230.0000.00716.46
7.4.220.0200.00716.34
7.4.210.0090.00816.54
7.4.200.0030.00316.38
7.4.160.0060.01416.43
7.4.150.0080.01217.40
7.4.140.0090.00917.86
7.4.130.0130.01216.40
7.4.120.0120.01016.58
7.4.110.0070.01016.46
7.4.100.0160.00716.47
7.4.90.0100.00616.51
7.4.80.0040.01519.39
7.4.70.0100.00716.72
7.4.60.0120.00316.51
7.4.50.0100.00616.54
7.4.40.0100.00716.44
7.4.30.0060.00916.41
7.4.00.0070.01014.76
7.3.330.0060.00013.16
7.3.320.0030.00313.24
7.3.310.0040.00416.41
7.3.300.0000.00716.29
7.3.290.0050.00216.20
7.3.280.0080.00916.36
7.3.270.0030.01317.40
7.3.260.0080.00816.54
7.3.250.0070.01116.39
7.3.240.0090.01016.47
7.3.230.0140.00616.44
7.3.210.0070.01016.30
7.3.200.0070.00916.53
7.3.190.0080.00816.35
7.3.180.0110.00716.45
7.3.170.0100.00716.67
7.3.160.0120.00616.46
7.2.330.0190.00616.93
7.2.320.0090.00916.80
7.2.310.0170.00716.46
7.2.300.0110.00716.45
7.2.290.0100.01016.86
7.2.90.0940.01014.58
7.2.80.0880.01314.76
7.2.70.0800.01015.15
7.2.60.1500.01314.98
7.2.50.1070.00315.00
7.2.40.1140.01414.78
7.2.30.0800.01015.00
7.2.20.0770.01314.89
7.2.10.0860.00715.20
7.2.00.0680.01014.90
7.1.210.1110.00714.08
7.1.200.1140.00314.06
7.1.190.1390.01013.75
7.1.180.1410.01313.93
7.1.170.1250.01013.95
7.1.160.0900.01013.97
7.1.150.1600.00713.66
7.1.140.0910.00013.95
7.1.130.0880.01113.57
7.1.120.1290.00713.89
7.1.110.1510.01014.08
7.1.100.0800.01013.85
7.1.90.1490.00313.89
7.1.80.1090.01013.68
7.1.70.1050.01013.79
7.1.60.1520.01432.04
7.1.50.1240.01031.99
7.1.40.0680.00631.90
7.1.30.0240.01331.77
7.1.20.0790.01331.87
7.1.10.0620.01114.04
7.1.00.0100.00713.77
7.0.310.0860.01013.72
7.0.300.1030.00713.51
7.0.290.0830.01012.97
7.0.280.1340.00013.09
7.0.270.1020.00613.18
7.0.260.1230.01013.37
7.0.250.0930.00313.27
7.0.240.0760.01313.12
7.0.230.1450.01013.61
7.0.220.1160.00013.29
7.0.210.1170.00613.30
7.0.200.1910.01013.25
7.0.190.2420.00313.35
7.0.180.0380.01613.11
7.0.170.0190.00813.49
7.0.160.0110.01513.45
7.0.150.0110.00313.39
7.0.140.1410.00313.53
7.0.130.0190.01213.48
7.0.120.0210.00013.18
7.0.110.0100.01113.46
7.0.100.0140.00713.54
7.0.90.0060.01213.53
7.0.80.0360.00313.42
7.0.70.0110.00913.48
7.0.60.2570.01013.66
7.0.50.0090.00913.46
7.0.40.0110.00713.23
7.0.30.0080.01213.41
7.0.20.0140.00613.49
7.0.10.0110.00713.45
7.0.00.0690.00313.61

preferences:
41.71 ms | 401 KiB | 5 Q