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']; $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.0110.00716.50
8.3.50.0120.00316.40
8.3.40.0090.00618.89
8.3.30.0120.00418.81
8.3.20.0040.00420.18
8.3.10.0040.00423.65
8.3.00.0120.00019.35
8.2.180.0140.00718.29
8.2.170.0110.00422.96
8.2.160.0040.01120.47
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00021.10
8.2.120.0080.00026.35
8.2.110.0090.00020.17
8.2.100.0120.00017.84
8.2.90.0070.00319.16
8.2.80.0080.00017.97
8.2.70.0120.00617.38
8.2.60.0050.00318.05
8.2.50.0040.00418.10
8.2.40.0040.00420.59
8.2.30.0000.00721.11
8.2.20.0020.00517.95
8.2.10.0040.00318.15
8.2.00.0060.00318.13
8.1.280.0140.00325.92
8.1.270.0040.00423.81
8.1.260.0040.00426.35
8.1.250.0070.00728.09
8.1.240.0060.00324.05
8.1.230.0090.00317.85
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.10
8.1.180.0030.00618.10
8.1.170.0080.00018.50
8.1.160.0030.00318.92
8.1.150.0080.00020.59
8.1.140.0040.00419.45
8.1.130.0000.00718.77
8.1.120.0040.00417.44
8.1.110.0000.00717.39
8.1.100.0020.00517.41
8.1.90.0000.00717.43
8.1.80.0000.00817.44
8.1.70.0050.00317.41
8.1.60.0040.00417.61
8.1.50.0000.00717.57
8.1.40.0040.00417.53
8.1.30.0030.00617.69
8.1.20.0080.00017.71
8.1.10.0060.00317.43
8.1.00.0070.00017.45
8.0.300.0070.00018.77
8.0.290.0000.00716.75
8.0.280.0070.00018.29
8.0.270.0070.00017.15
8.0.260.0030.00516.72
8.0.250.0050.00216.91
8.0.240.0050.00316.90
8.0.230.0060.00316.95
8.0.220.0070.00016.85
8.0.210.0000.00716.75
8.0.200.0000.00616.81
8.0.190.0000.01116.86
8.0.180.0000.00716.94
8.0.170.0030.00316.81
8.0.160.0040.00416.78
8.0.150.0050.00216.87
8.0.140.0000.00816.84
8.0.130.0000.00613.25
8.0.120.0000.00816.84
8.0.110.0040.00416.84
8.0.100.0000.00716.96
8.0.90.0040.00416.85
8.0.80.0070.01016.89
8.0.70.0040.00416.90
8.0.60.0000.00716.92
8.0.50.0030.00516.77
8.0.30.0080.00717.26
8.0.20.0130.00717.40
8.0.10.0070.00016.93
8.0.00.0000.01716.97
7.4.330.0020.00215.55
7.4.320.0030.00316.50
7.4.300.0000.00616.53
7.4.290.0100.00016.62
7.4.280.0030.00516.63
7.4.270.0070.00016.53
7.4.260.0030.00313.29
7.4.250.0060.00316.60
7.4.240.0040.00416.63
7.4.230.0030.00516.60
7.4.220.0130.01416.59
7.4.210.0080.00616.51
7.4.200.0000.00716.44
7.4.160.0120.00716.56
7.4.150.0180.00017.40
7.4.140.0110.01117.86
7.4.130.0080.01216.36
7.4.120.0080.01116.44
7.4.110.0070.01016.43
7.4.100.0040.01516.46
7.4.90.0120.00616.54
7.4.80.0090.00919.39
7.4.70.0130.00316.60
7.4.60.0080.00816.49
7.4.50.0060.00616.32
7.4.40.0100.00716.48
7.4.30.0070.01016.60
7.4.00.0040.01114.73
7.3.330.0030.00313.16
7.3.320.0000.00513.15
7.3.310.0070.00016.23
7.3.300.0000.00716.38
7.3.290.0040.00416.35
7.3.280.0080.00916.35
7.3.270.0090.00917.40
7.3.260.0130.00416.46
7.3.250.0110.00716.43
7.3.240.0080.00916.62
7.3.230.0130.01316.62
7.3.210.0030.01416.46
7.3.200.0060.01016.32
7.3.190.0060.01216.62
7.3.180.0090.00616.34
7.3.170.0090.00616.39
7.3.160.0170.00316.51
7.2.330.0110.00916.70
7.2.320.0150.00616.73
7.2.310.0100.00716.47
7.2.300.0060.01616.77
7.2.290.0140.00716.55
7.2.90.0080.00814.36
7.2.80.0440.00914.75
7.2.70.0090.00515.09
7.2.60.0080.01214.96
7.2.50.0110.00614.91
7.2.40.0480.00314.73
7.2.30.0080.00815.02
7.2.20.0040.00814.88
7.2.10.0110.00815.09
7.2.00.0090.00614.77
7.1.210.0130.00013.82
7.1.200.0310.00614.04
7.1.190.0080.00513.91
7.1.180.0100.00713.68
7.1.170.0260.01413.95
7.1.160.0160.00013.86
7.1.150.0060.00613.89
7.1.140.0070.00513.93
7.1.130.0090.00913.83
7.1.120.0060.00913.75
7.1.110.0160.01214.03
7.1.100.0970.00613.91
7.1.90.0680.00713.62
7.1.80.0160.00013.76
7.1.70.2440.00313.74
7.1.60.2870.01131.88
7.1.50.0280.02031.77
7.1.40.2290.01031.97
7.1.30.1860.02031.87
7.1.20.0260.01031.89
7.1.10.2050.00013.46
7.1.00.0600.00613.91
7.0.310.1030.01013.72
7.0.300.0120.00313.42
7.0.290.0630.00013.40
7.0.280.0100.00313.26
7.0.270.0430.00413.64
7.0.260.0350.00313.57
7.0.250.0230.00713.60
7.0.240.0110.01113.61
7.0.230.0090.00413.12
7.0.220.0120.00613.38
7.0.210.2930.01313.46
7.0.200.3470.00313.46
7.0.190.0550.01513.30
7.0.180.2190.01613.57
7.0.170.0570.00413.26
7.0.160.2080.00013.39
7.0.150.2270.01013.36
7.0.140.0120.00713.25
7.0.130.0110.00713.57
7.0.120.0140.00713.63
7.0.110.0790.00613.50
7.0.100.0180.00713.24
7.0.90.0350.00913.58
7.0.80.0060.01113.29
7.0.70.0700.00713.38
7.0.60.0040.01613.85
7.0.50.1160.01113.34
7.0.40.0720.01013.73
7.0.30.1900.00613.13
7.0.20.2420.00613.68
7.0.10.1200.00313.62
7.0.00.0150.01013.14

preferences:
39.05 ms | 400 KiB | 5 Q