3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $id; public function __set($key, $value) { if (isset($this->$key)) $this->$key = $value; // throw new Exception() could be added here } public function __get($key) { return isset($this->$key) ? $this->$key : null; } public function __call($name, $arguments) { $matches = array(); $pattern = '/^set([A-Za-z0-9]+)/'; if (preg_match($pattern, $name, $matches)) { //var_dump($arguments, $matches); $method = strtolower($matches[1]); $this->$method($arguments[0]); } } } $test = new Test; $test->setId(25); var_dump($test);

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.00316.61
8.3.50.0120.00516.73
8.3.40.0120.00319.04
8.3.30.0110.00418.84
8.3.20.0080.00018.73
8.3.10.0080.00020.53
8.3.00.0060.00317.63
8.2.180.0100.00717.00
8.2.170.0040.01422.96
8.2.160.0030.01020.52
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00419.89
8.2.110.0070.00419.17
8.2.100.0040.00717.91
8.2.90.0080.00019.21
8.2.80.0040.00417.97
8.2.70.0080.00017.88
8.2.60.0000.00817.90
8.2.50.0040.00418.07
8.2.40.0080.00018.16
8.2.30.0040.00418.21
8.2.20.0000.00717.83
8.2.10.0080.00017.78
8.2.00.0050.00217.75
8.1.280.0180.00025.92
8.1.270.0040.00424.66
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00620.78
8.1.230.0060.00617.60
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0100.00017.48
8.1.190.0030.00617.38
8.1.180.0060.00318.10
8.1.170.0000.00818.77
8.1.160.0070.00018.87
8.1.150.0080.00018.81
8.1.140.0000.00917.41
8.1.130.0040.00417.90
8.1.120.0000.00717.48
8.1.110.0000.00717.43
8.1.100.0030.00417.52
8.1.90.0000.00717.53
8.1.80.0040.00417.47
8.1.70.0000.00717.45
8.1.60.0040.00417.79
8.1.50.0050.00217.60
8.1.40.0030.00617.67
8.1.30.0040.00417.83
8.1.20.0000.00917.73
8.1.10.0040.00417.79
8.1.00.0050.00217.67
8.0.300.0040.00418.77
8.0.290.0030.00517.00
8.0.280.0030.00318.48
8.0.270.0050.00317.16
8.0.260.0070.00016.92
8.0.250.0000.00717.10
8.0.240.0090.00016.97
8.0.230.0040.00417.05
8.0.220.0000.00717.01
8.0.210.0040.00417.05
8.0.200.0030.00316.92
8.0.190.0040.00617.02
8.0.180.0040.00416.99
8.0.170.0000.00916.90
8.0.160.0040.00416.91
8.0.150.0030.00616.97
8.0.140.0000.00716.97
8.0.130.0060.00013.48
8.0.120.0000.00816.96
8.0.110.0040.00416.97
8.0.100.0040.00416.92
8.0.90.0000.00717.12
8.0.80.0120.00417.02
8.0.70.0030.00517.05
8.0.60.0040.00416.94
8.0.50.0050.00316.79
8.0.30.0130.00917.00
8.0.20.0080.01217.12
8.0.10.0000.00717.15
8.0.00.0070.01117.13
7.4.330.0060.00013.17
7.4.320.0030.00316.74
7.4.300.0000.00816.76
7.4.290.0070.00016.85
7.4.280.0080.00016.68
7.4.270.0060.00316.88
7.4.260.0060.00013.49
7.4.250.0030.00616.64
7.4.240.0050.00316.81
7.4.230.0030.00516.90
7.4.220.0160.01016.70
7.4.210.0080.00916.80
7.4.200.0000.00716.53
7.4.190.0000.00716.87
7.4.160.0060.01016.64
7.4.150.0170.00016.76
7.4.140.0110.00916.64
7.4.130.0100.01016.66
7.4.120.0050.01516.63
7.4.110.0030.01316.65
7.4.100.0100.00716.70
7.4.90.0140.00716.63
7.4.80.0090.00916.60
7.4.70.0090.00916.46
7.4.60.0070.01016.50
7.4.50.0050.00516.77
7.4.40.0110.00416.51
7.4.30.0060.01016.79
7.4.00.0110.00415.19
7.3.330.0060.00013.41
7.3.320.0000.00813.43
7.3.310.0040.00416.46
7.3.300.0050.00216.50
7.3.290.0030.01116.53
7.3.280.0080.00716.47
7.3.270.0110.00616.41
7.3.260.0130.00916.51
7.3.250.0100.00716.75
7.3.240.0090.00916.46
7.3.230.0100.00716.45
7.3.210.0110.00616.70
7.3.200.0060.01219.39
7.3.190.0130.00716.77
7.3.180.0080.00816.68
7.3.170.0000.01716.44
7.3.160.0100.00716.31
7.3.120.0070.01014.92
7.2.330.0140.00316.75
7.2.320.0070.01116.84
7.2.310.0070.01116.83
7.2.300.0160.00016.73
7.2.290.0070.01516.60
7.2.00.0100.00719.38
7.1.100.0040.00718.45
7.1.70.0090.00017.44
7.1.60.0160.00919.40
7.1.50.0030.01316.82
7.1.00.0030.05322.30
7.0.200.0230.00314.89
7.0.140.0030.07721.96
7.0.120.0030.07322.09
7.0.60.0100.08320.01
7.0.50.0100.07717.88
7.0.40.0070.06320.16
7.0.30.0300.04720.10
7.0.20.0230.03320.11
7.0.10.0070.09020.09
7.0.00.0130.06320.27
5.6.280.0070.07021.17
5.6.210.0100.07320.62
5.6.200.0030.05718.27
5.6.190.0070.07320.59
5.6.180.0230.04320.48
5.6.170.0200.06020.50
5.6.160.0070.06320.34
5.6.150.0130.07718.18
5.6.140.0030.06018.14
5.6.130.0070.08718.25
5.6.120.0100.08021.13
5.6.110.0030.05321.15
5.6.100.0030.04021.14
5.6.90.0100.04321.04
5.6.80.0130.07320.53
5.6.70.3930.03320.53
5.5.350.0100.08020.33
5.5.340.0030.05317.99
5.5.330.0130.06320.13
5.5.320.3270.04320.51
5.5.310.0200.04020.32
5.5.300.0170.07318.08
5.5.290.0070.04718.08
5.5.280.0070.07320.79
5.5.270.0130.07020.88
5.5.260.0070.07720.66
5.5.250.0070.07720.79
5.5.240.0070.06020.16
5.4.450.0100.06319.45
5.4.440.0170.05319.33
5.4.430.0100.07319.46
5.4.420.0100.07319.17
5.4.410.0070.07019.41
5.4.400.0170.06318.96
5.4.390.0100.07319.11
5.4.380.0030.04718.97
5.4.370.0030.04719.24
5.4.360.0000.06719.14
5.4.350.0030.07318.85
5.4.340.0030.05319.02
5.4.320.0070.05719.15
5.4.310.0130.06719.25
5.4.300.0070.05019.14
5.4.290.0030.06018.91
5.4.280.0100.07719.14
5.4.270.0070.07719.24
5.4.260.0030.04019.23
5.4.250.0070.04319.14
5.4.240.0070.03719.14
5.4.230.0030.04018.92
5.4.220.0030.07318.97
5.4.210.0030.06718.84
5.4.200.0100.06719.14
5.4.190.0070.07719.23
5.4.180.0070.04318.91
5.4.170.0070.05318.97
5.4.160.0070.05019.13
5.4.150.0070.05319.22
5.4.140.0130.04716.46
5.4.130.0070.04316.45
5.4.120.0000.05016.34
5.4.110.0170.06716.53
5.4.100.0070.05716.49
5.4.90.0030.04716.45
5.4.80.0000.07316.29
5.4.70.0030.04716.39
5.4.60.0030.04716.46
5.4.50.0070.07016.34
5.4.40.0030.05016.41
5.4.30.0070.04016.39
5.4.20.0000.03716.46
5.4.10.0070.03716.34
5.4.00.0000.03715.99
5.3.290.0100.07714.74
5.3.280.0170.04314.60
5.3.270.0100.04014.66
5.3.260.0130.06714.64
5.3.250.0030.05014.76
5.3.240.0000.04714.62
5.3.230.0070.07714.59
5.3.220.0030.06714.60
5.3.210.0130.05714.64
5.3.200.0030.08014.71
5.3.190.0200.06314.64
5.3.180.0070.08014.64
5.3.170.0100.07014.59
5.3.160.0100.07014.50
5.3.150.0100.05714.61
5.3.140.0100.07014.48
5.3.130.0070.04014.55
5.3.120.0030.03714.59
5.3.110.0070.03714.65
5.3.100.0070.03314.07
5.3.90.0070.03314.05
5.3.80.0030.03714.07
5.3.70.0070.03014.08
5.3.60.0030.04013.98
5.3.50.0000.04013.97
5.3.40.0030.03714.01
5.3.30.0070.03013.95
5.3.20.0000.05713.84
5.3.10.0030.03313.81
5.3.00.0070.06313.70
5.2.170.0000.03311.16
5.2.160.0000.03011.32
5.2.150.0030.02711.20
5.2.140.0000.03011.14
5.2.130.0100.05711.07
5.2.120.0070.02711.26
5.2.110.0030.05711.16
5.2.100.0030.03311.12
5.2.90.0000.03311.13
5.2.80.0030.05011.07
5.2.70.0070.05711.26
5.2.60.0030.04011.06
5.2.50.0000.03010.98
5.2.40.0070.02311.06
5.2.30.0000.03011.14
5.2.20.0000.03311.13
5.2.10.0070.02310.79
5.2.00.0000.03310.78
5.1.60.0030.02310.16
5.1.50.0070.02010.07
5.1.40.0000.0239.95
5.1.30.0000.02710.26
5.1.20.0000.02710.35
5.1.10.0030.02710.09
5.1.00.0030.02310.04
5.0.50.0000.0208.57
5.0.40.0000.0208.48
5.0.30.0070.0308.28
5.0.20.0030.0178.36
5.0.10.0000.0208.20
5.0.00.0070.0238.15
4.4.90.0000.0177.87
4.4.80.0000.0177.87
4.4.70.0030.0137.87
4.4.60.0100.0077.87
4.4.50.0000.0177.87
4.4.40.0000.0237.87
4.4.30.0000.0177.87
4.4.20.0000.0177.87
4.4.10.0000.0137.87
4.4.00.0000.0277.87
4.3.110.0000.0137.87
4.3.100.0000.0177.87
4.3.90.0030.0137.87
4.3.80.0030.0237.87
4.3.70.0000.0177.87
4.3.60.0000.0137.87
4.3.50.0000.0207.87
4.3.40.0000.0237.87
4.3.30.0000.0137.87
4.3.20.0000.0137.87
4.3.10.0000.0137.87
4.3.00.0000.0177.87

preferences:
42.53 ms | 401 KiB | 5 Q