3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $myName; 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); $property = $matches[1]; $property = strtolower($property[0]) . substr($property, 1, strlen($property)-1); var_dump($property, isset($this->$property)); if (isset($this->$property)) $this->$property = $arguments[0]; } } } $test = new Test; $test->setMyName(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.0090.00616.63
8.3.50.0140.00222.07
8.3.40.0110.00418.96
8.3.30.0030.01219.04
8.3.20.0040.00420.12
8.3.10.0080.00023.61
8.3.00.0090.00020.48
8.2.180.0110.00718.79
8.2.170.0070.01422.96
8.2.160.0100.00622.39
8.2.150.0070.00724.18
8.2.140.0060.00324.66
8.2.130.0130.00626.16
8.2.120.0040.00422.39
8.2.110.0030.00622.10
8.2.100.0070.00717.94
8.2.90.0050.00319.41
8.2.80.0040.00418.05
8.2.70.0040.00417.75
8.2.60.0080.00318.03
8.2.50.0070.00318.07
8.2.40.0040.00419.34
8.2.30.0030.00618.05
8.2.20.0040.00417.97
8.2.10.0050.00319.74
8.2.00.0050.00317.91
8.1.280.0120.00625.92
8.1.270.0080.00023.97
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00618.74
8.1.230.0040.00719.07
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0000.00917.35
8.1.190.0050.00317.43
8.1.180.0080.00018.10
8.1.170.0040.00418.78
8.1.160.0040.00422.06
8.1.150.0080.00018.81
8.1.140.0000.00917.71
8.1.130.0060.00317.91
8.1.120.0040.00417.63
8.1.110.0000.00717.68
8.1.100.0040.00417.52
8.1.90.0000.00717.66
8.1.80.0030.00317.63
8.1.70.0000.00717.55
8.1.60.0060.00317.79
8.1.50.0030.00617.65
8.1.40.0080.00017.58
8.1.30.0000.00817.70
8.1.20.0040.00417.77
8.1.10.0070.00017.80
8.1.00.0050.00317.75
8.0.300.0040.00418.77
8.0.290.0060.00317.05
8.0.280.0030.00318.42
8.0.270.0030.00317.25
8.0.260.0000.00716.98
8.0.250.0000.00717.16
8.0.240.0070.00017.14
8.0.230.0050.00317.12
8.0.220.0000.00717.07
8.0.210.0030.00317.02
8.0.200.0060.00016.98
8.0.190.0000.00817.16
8.0.180.0040.00417.08
8.0.170.0040.00416.93
8.0.160.0030.00517.13
8.0.150.0080.00016.96
8.0.140.0040.00417.03
8.0.130.0050.00013.50
8.0.120.0000.00817.04
8.0.110.0040.00417.01
8.0.100.0000.00817.12
8.0.90.0000.00817.02
8.0.80.0090.00917.06
8.0.70.0000.00716.86
8.0.60.0040.00417.09
8.0.50.0000.00717.08
8.0.30.0100.01017.47
8.0.20.0100.01617.51
8.0.10.0000.00717.00
8.0.00.0130.00416.99
7.4.330.0000.00515.22
7.4.320.0030.00316.75
7.4.300.0000.00616.73
7.4.290.0040.00416.80
7.4.280.0040.00416.82
7.4.270.0000.00716.82
7.4.260.0000.00816.71
7.4.250.0050.00216.82
7.4.240.0000.00716.78
7.4.230.0000.00716.87
7.4.220.0060.01216.78
7.4.210.0120.00516.79
7.4.200.0070.00016.75
7.4.190.0070.00016.80
7.4.160.0170.00016.71
7.4.150.0170.00017.40
7.4.140.0090.00917.86
7.4.130.0140.00516.75
7.4.120.0100.01316.66
7.4.110.0070.01016.64
7.4.100.0060.01016.81
7.4.90.0100.00716.58
7.4.80.0130.00316.76
7.4.70.0030.01316.75
7.4.60.0100.00716.75
7.4.50.0030.00516.45
7.4.40.0030.01022.77
7.4.30.0090.00616.65
7.4.00.0040.01114.97
7.3.330.0050.00013.52
7.3.320.0000.00613.38
7.3.310.0070.00016.58
7.3.300.0000.00716.60
7.3.290.0100.00316.54
7.3.280.0090.00716.50
7.3.270.0080.00817.40
7.3.260.0060.01216.80
7.3.250.0070.01116.55
7.3.240.0030.01316.43
7.3.230.0100.01016.49
7.3.210.0060.01116.61
7.3.200.0100.01019.39
7.3.190.0090.00816.64
7.3.180.0080.00816.64
7.3.170.0060.01016.77
7.3.160.0100.00716.54
7.3.120.0040.01115.24
7.2.330.0110.01116.95
7.2.320.0090.00916.86
7.2.310.0070.01017.00
7.2.300.0110.00616.84
7.2.290.0080.00816.79
7.2.00.0130.00319.20
7.1.100.0000.01218.41
7.1.70.0070.00017.14
7.1.60.0060.01919.32
7.1.50.0110.01117.30
7.1.00.0000.08022.47
7.0.200.0000.00716.98
7.0.140.0030.07022.09
7.0.100.0100.07720.02
7.0.90.0070.06020.14
7.0.80.0100.07719.89
7.0.70.0070.08019.88
7.0.60.0070.05319.95
7.0.50.0100.07720.33
7.0.40.0070.08320.09
7.0.30.0100.07720.06
7.0.20.0170.04720.09
7.0.10.0100.06720.13
7.0.00.0230.06320.10
5.6.280.0030.07320.78
5.6.250.0070.07020.59
5.6.240.0100.08020.63
5.6.230.0100.07720.74
5.6.220.0030.05320.64
5.6.210.0000.08720.46
5.6.200.0130.07721.02
5.6.190.0170.07720.97
5.6.180.0070.08321.11
5.6.170.0170.07721.11
5.6.160.0100.05020.97
5.6.150.0070.08321.12
5.6.140.0170.07721.14
5.6.130.0100.08721.14
5.6.120.0070.08321.01
5.6.110.0170.07721.08
5.6.100.0030.07321.02
5.6.90.0100.07721.12
5.6.80.0130.07020.44
5.6.70.0070.05020.40
5.6.60.0070.07320.40
5.6.50.0130.07320.55
5.6.40.0070.08020.47
5.6.30.0000.07320.39
5.6.20.0230.03720.30
5.6.10.0100.08020.36
5.6.00.0070.07320.45
5.5.380.0030.07720.45
5.5.370.0130.07320.34
5.5.360.0070.08020.34
5.5.350.0100.07320.47
5.5.340.0170.07720.75
5.5.330.0070.07320.89
5.5.320.0070.08320.87
5.5.310.0230.06020.94
5.5.300.0100.07020.79
5.5.290.0100.07720.82
5.5.280.0130.08020.93
5.5.270.0030.08320.69
5.5.260.0100.08020.88
5.5.250.0070.08020.61
5.5.240.0030.08020.26
5.5.230.0030.07720.19
5.5.220.0030.05320.26
5.5.210.0130.07020.32
5.5.200.0070.07720.13
5.5.190.0170.07020.13
5.5.180.0100.07320.00
5.5.160.0100.07720.26
5.5.150.0070.05020.22
5.5.140.0100.03720.27
5.5.130.0000.05720.19
5.5.120.0000.05320.29
5.5.110.0130.07020.19
5.5.100.0100.07719.96
5.5.90.0030.07720.08
5.5.80.0070.07320.09
5.5.70.0130.07020.08
5.5.60.0100.05720.15
5.5.50.0130.07020.10
5.5.40.0100.07320.09
5.5.30.0030.04720.05
5.5.20.0030.06320.06
5.5.10.0030.05020.03
5.5.00.0130.04320.04
5.4.450.0100.07719.46
5.4.440.0030.08019.21
5.4.430.0070.07719.41
5.4.420.0170.07019.49
5.4.410.0170.05719.41
5.4.400.0100.06719.04
5.4.390.0130.06318.90
5.4.380.0100.07719.05
5.4.370.0000.08019.05
5.4.360.0100.07718.85
5.4.350.0100.07019.19
5.4.340.0070.07719.09
5.4.320.0130.07018.90
5.4.310.0030.07719.03
5.4.300.0030.08019.12
5.4.290.0100.06718.85
5.4.280.0030.08319.13
5.4.270.0030.08319.13
5.4.260.0070.08019.18
5.4.250.0170.06719.25
5.4.240.0100.07319.02
5.4.230.0030.05018.94
5.4.220.0130.06719.11
5.4.210.0100.07319.18
5.4.200.0130.07318.94
5.4.190.0070.05318.84
5.4.180.0130.03718.87
5.4.170.0030.06718.90
5.4.160.0030.06718.83
5.4.150.0000.07719.11
5.4.140.0130.04716.45
5.4.130.0070.07316.41
5.4.120.0130.07016.28
5.4.110.0070.09016.48
5.4.100.0070.06716.51
5.4.90.0100.06716.47
5.4.80.0000.07716.41
5.4.70.0070.06716.50
5.4.60.0030.06016.42
5.4.50.0100.05016.47
5.4.40.0070.07316.52
5.4.30.0070.05716.44
5.4.20.0100.07316.40
5.4.10.0170.06716.38
5.4.00.0030.07315.73
5.3.290.0100.04314.80
5.3.280.0030.07314.72
5.3.270.0170.06314.67
5.3.260.0030.06014.55
5.3.250.0070.07314.63
5.3.240.0130.06714.75
5.3.230.0070.07714.58
5.3.220.0070.06314.55
5.3.210.0100.07314.59
5.3.200.0030.07014.70
5.3.190.0100.07314.71
5.3.180.0070.07014.63
5.3.170.0100.04314.64
5.3.160.0100.07014.55
5.3.150.0030.07714.68
5.3.140.0130.06014.61
5.3.130.0030.07014.65
5.3.120.0100.06314.51
5.3.110.0130.06314.50
5.3.100.0030.07714.02
5.3.90.0070.05314.12
5.3.80.0070.07314.09
5.3.70.0030.06314.08
5.3.60.0100.07013.93
5.3.50.0100.04013.98
5.3.40.0130.06714.01
5.3.30.0030.07713.84
5.3.20.0100.06713.76
5.3.10.0100.07313.66
5.3.00.0030.06013.58
5.2.170.0030.06711.29
5.2.160.0030.06011.21
5.2.150.0070.06311.26
5.2.140.0070.06311.26
5.2.130.0070.03311.24
5.2.120.0030.06011.14
5.2.110.0200.04711.16
5.2.100.0030.06010.97
5.2.90.0000.06711.10
5.2.80.0030.03311.24
5.2.70.0070.03311.17
5.2.60.0000.04311.11
5.2.50.0100.05711.12
5.2.40.0030.05011.07
5.2.30.0030.06010.91
5.2.20.0000.06010.84
5.2.10.0070.05710.96
5.2.00.0070.04310.84
5.1.60.0000.04310.06
5.1.50.0030.04710.05
5.1.40.0000.05710.05
5.1.30.0030.06010.40
5.1.20.0100.04710.28
5.1.10.0030.06010.05
5.1.00.0030.05710.17
5.0.50.0000.05010.05
5.0.40.0030.04310.05
5.0.30.0130.03310.05
5.0.20.0030.04710.05
5.0.10.0070.04010.05
5.0.00.0000.05710.05
4.4.90.0000.04010.05
4.4.80.0100.03010.05
4.4.70.0000.03710.05
4.4.60.0000.03010.05
4.4.50.0100.03010.05
4.4.40.0070.05010.05
4.4.30.0000.01710.05
4.4.20.0030.03310.05
4.4.10.0030.03710.05
4.4.00.0000.04010.05
4.3.110.0000.03710.05
4.3.100.0000.03710.05
4.3.90.0070.03010.05
4.3.80.0000.05310.05
4.3.70.0030.03310.05
4.3.60.0030.03310.05
4.3.50.0000.02310.05
4.3.40.0030.05010.05
4.3.30.0000.02010.05
4.3.20.0070.03010.05
4.3.10.0030.03310.05
4.3.00.0030.03310.05

preferences:
38.44 ms | 401 KiB | 5 Q