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); $property = strtolower($matches[1]); //var_dump($property); if (isset($this->$property)) $this->$property = $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.0090.00616.63
8.3.50.0090.01222.01
8.3.40.0070.01419.00
8.3.30.0110.00419.04
8.3.20.0060.00320.27
8.3.10.0080.00023.54
8.3.00.0050.00320.54
8.2.180.0090.00918.54
8.2.170.0110.00422.96
8.2.160.0070.00722.02
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0000.00826.16
8.2.120.0000.00822.43
8.2.110.0000.00922.38
8.2.100.0100.00317.97
8.2.90.0000.00819.34
8.2.80.0000.00817.97
8.2.70.0030.00618.00
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0040.00419.34
8.2.30.0040.00418.21
8.2.20.0080.00017.88
8.2.10.0000.00717.82
8.2.00.0030.00617.82
8.1.280.0070.01425.92
8.1.270.0080.00023.96
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0060.00323.88
8.1.230.0030.00719.16
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0040.00717.25
8.1.190.0030.00617.18
8.1.180.0080.00018.10
8.1.170.0030.00618.71
8.1.160.0040.00421.98
8.1.150.0040.00418.85
8.1.140.0040.00417.52
8.1.130.0030.00317.76
8.1.120.0080.00017.68
8.1.110.0040.00417.51
8.1.100.0000.00717.57
8.1.90.0000.00717.69
8.1.80.0070.00017.57
8.1.70.0030.00317.52
8.1.60.0030.00617.73
8.1.50.0000.00817.58
8.1.40.0070.00017.58
8.1.30.0060.00317.81
8.1.20.0080.00017.71
8.1.10.0080.00017.73
8.1.00.0040.00417.61
8.0.300.0050.00218.77
8.0.290.0000.00717.18
8.0.280.0040.00418.52
8.0.270.0030.00317.23
8.0.260.0030.00616.98
8.0.250.0000.00717.12
8.0.240.0030.00317.02
8.0.230.0070.00017.09
8.0.220.0070.00017.09
8.0.210.0040.00416.98
8.0.200.0030.00317.11
8.0.190.0040.00417.14
8.0.180.0040.00417.07
8.0.170.0000.00817.00
8.0.160.0040.00417.16
8.0.150.0070.00016.98
8.0.140.0000.00817.02
8.0.130.0000.00613.43
8.0.120.0000.00817.00
8.0.110.0000.00717.01
8.0.100.0050.00216.91
8.0.90.0030.00717.05
8.0.80.0030.01317.05
8.0.70.0040.00416.87
8.0.60.0000.00717.07
8.0.50.0040.00417.08
8.0.30.0100.01016.96
8.0.20.0110.00917.40
8.0.10.0040.00417.17
8.0.00.0140.00516.95
7.4.330.0000.00615.08
7.4.320.0030.00316.67
7.4.300.0000.00616.71
7.4.290.0030.00316.58
7.4.280.0040.00416.61
7.4.270.0030.00316.81
7.4.260.0000.00716.60
7.4.250.0070.00016.74
7.4.240.0040.00316.65
7.4.230.0070.00016.84
7.4.220.0140.00316.77
7.4.210.0110.00816.88
7.4.200.0070.00016.80
7.4.190.0000.00716.62
7.4.160.0060.01016.67
7.4.150.0150.00317.40
7.4.140.0100.00717.86
7.4.130.0090.00916.94
7.4.120.0090.01216.78
7.4.110.0140.00416.76
7.4.100.0240.00016.66
7.4.90.0100.01016.53
7.4.80.0090.00916.91
7.4.70.0170.00616.75
7.4.60.0150.00616.71
7.4.50.0000.00616.67
7.4.40.0120.00622.77
7.4.30.0000.01716.70
7.4.00.0150.00315.21
7.3.330.0000.00613.46
7.3.320.0000.00613.25
7.3.310.0000.00716.48
7.3.300.0000.00616.41
7.3.290.0100.01016.52
7.3.280.0130.00516.52
7.3.270.0090.00917.40
7.3.260.0070.01016.43
7.3.250.0100.00616.39
7.3.240.0080.01216.36
7.3.230.0100.00616.40
7.3.210.0160.00316.76
7.3.200.0100.00719.39
7.3.190.0120.00616.54
7.3.180.0130.00316.46
7.3.170.0090.00616.63
7.3.160.0100.00716.46
7.3.120.0050.01214.95
7.3.110.0110.00615.28
7.3.100.0090.00914.63
7.3.90.0100.00614.83
7.3.80.0030.01015.26
7.3.70.0140.00014.97
7.3.60.0030.00615.02
7.3.50.0040.01215.07
7.3.40.0130.00314.80
7.3.30.0040.00414.72
7.3.20.0000.01316.79
7.3.10.0000.01416.89
7.3.00.0040.01216.75
7.2.330.0120.00916.62
7.2.320.0070.01016.54
7.2.310.0150.00716.78
7.2.300.0100.00717.04
7.2.290.0070.01016.79
7.2.250.0060.01315.27
7.2.240.0070.01115.13
7.2.230.0030.01014.98
7.2.220.0040.01415.22
7.2.210.0070.00715.29
7.2.200.0060.01015.18
7.2.190.0120.00015.46
7.2.180.0070.01015.19
7.2.170.0100.00315.36
7.2.60.0070.00716.98
7.2.00.0030.00919.72
7.1.330.0030.00916.06
7.1.320.0080.00415.87
7.1.310.0070.00715.88
7.1.300.0060.00616.13
7.1.290.0160.00015.79
7.1.280.0030.00615.80
7.1.270.0040.01116.05
7.1.260.0110.00415.93
7.1.200.0000.01315.90
7.1.100.0050.00518.59
7.1.70.0040.01117.47
7.1.60.0040.00717.22
7.1.50.0070.01417.15
7.1.00.0070.07322.38
7.0.200.0000.01316.86
7.0.140.0100.06022.12
7.0.100.0170.08020.03
7.0.90.0430.07719.88
7.0.80.0300.06719.90
7.0.70.0100.08019.90
7.0.60.0330.05019.88
7.0.50.0070.04720.34
7.0.40.0100.08020.18
7.0.30.0130.04720.19
7.0.20.0170.06720.04
7.0.10.0130.06720.13
7.0.00.0130.07720.07
5.6.280.0030.07021.07
5.6.250.0100.07320.82
5.6.240.0100.05720.64
5.6.230.0070.08320.64
5.6.220.0030.08320.56
5.6.210.0000.08720.75
5.6.200.0130.07721.03
5.6.190.0170.07321.15
5.6.180.0100.08020.95
5.6.170.0030.04321.15
5.6.160.0070.07321.09
5.6.150.0170.07721.09
5.6.140.0100.08021.03
5.6.130.0100.07721.14
5.6.120.0130.08321.11
5.6.110.0100.07720.94
5.6.100.0100.03721.12
5.6.90.0070.04020.97
5.6.80.0030.04020.53
5.6.70.0030.05020.43
5.6.60.0030.03320.45
5.6.50.0070.03720.47
5.6.40.0070.03720.31
5.6.30.0000.04320.50
5.6.20.0030.04020.39
5.6.10.0030.04020.50
5.6.00.0030.04020.43
5.5.380.0070.05020.58
5.5.370.0130.06720.39
5.5.360.0070.07020.56
5.5.350.0000.05720.39
5.5.340.0100.07320.89
5.5.330.0070.06320.78
5.5.320.0130.07320.79
5.5.310.0000.09320.87
5.5.300.0030.05320.65
5.5.290.0100.04720.79
5.5.280.0070.08020.65
5.5.270.0130.07020.91
5.5.260.0000.07320.76
5.5.250.0000.04320.62
5.5.240.0000.04320.04
5.5.230.0000.04320.29
5.5.220.0030.04320.25
5.5.210.0070.03020.26
5.5.200.0000.04020.23
5.5.190.0000.04020.19
5.5.180.0070.03720.20
5.5.160.0030.04020.29
5.5.150.0070.03320.29
5.5.140.0030.03720.22
5.5.130.0100.03320.13
5.5.120.0030.04720.22
5.5.110.0070.05020.15
5.5.100.0070.03720.12
5.5.90.0100.03320.17
5.5.80.0030.04019.95
5.5.70.0070.03720.04
5.5.60.0000.06720.06
5.5.50.0070.03719.97
5.5.40.0000.04320.06
5.5.30.0100.03319.96
5.5.20.0070.03720.00
5.5.10.0030.04020.04
5.5.00.0030.04020.05
5.4.450.0100.08019.25
5.4.440.0130.07319.35
5.4.430.0030.06319.55
5.4.420.0000.07319.50
5.4.410.0100.04019.24
5.4.400.0030.04018.93
5.4.390.0000.04319.04
5.4.380.0030.04019.04
5.4.370.0030.03719.05
5.4.360.0100.03318.86
5.4.350.0030.03719.14
5.4.340.0100.03019.16
5.4.320.0100.05018.90
5.4.310.0130.02718.95
5.4.300.0070.04019.02
5.4.290.0130.05018.90
5.4.280.0000.04318.95
5.4.270.0000.04319.04
5.4.260.0070.03319.16
5.4.250.0030.03718.90
5.4.240.0000.04018.95
5.4.230.0100.04719.03
5.4.220.0100.03318.85
5.4.210.0070.03719.23
5.4.200.0070.03719.12
5.4.190.0000.04319.20
5.4.180.0000.04019.22
5.4.170.0030.03719.11
5.4.160.0000.05319.11
5.4.150.0030.04018.84
5.4.140.0000.03716.44
5.4.130.0100.03016.26
5.4.120.0000.04016.27
5.4.110.0000.04016.36
5.4.100.0030.03716.27
5.4.90.0070.03316.39
5.4.80.0130.02716.32
5.4.70.0000.04316.45
5.4.60.0000.04016.32
5.4.50.0070.03316.34
5.4.40.0030.07716.54
5.4.30.0030.06716.41
5.4.20.0030.03316.44
5.4.10.0070.07316.44
5.4.00.0030.07015.94
5.3.290.0000.04014.81
5.3.280.0100.03014.55
5.3.270.0070.03314.74
5.3.260.0030.04014.59
5.3.250.0030.03714.60
5.3.240.0000.04314.68
5.3.230.0000.04014.66
5.3.220.0070.03314.59
5.3.210.0030.03714.58
5.3.200.0000.04314.66
5.3.190.0100.03014.53
5.3.180.0000.04014.55
5.3.170.0000.05014.49
5.3.160.0030.07714.52
5.3.150.0070.04714.71
5.3.140.0170.02314.58
5.3.130.0000.04714.71
5.3.120.0100.06714.51
5.3.110.0100.06014.48
5.3.100.0100.07714.02
5.3.90.0030.06714.06
5.3.80.0030.04014.05
5.3.70.0100.06314.01
5.3.60.0030.07014.02
5.3.50.0070.07013.87
5.3.40.0070.07714.01
5.3.30.0070.06713.98
5.3.20.0070.07013.63
5.3.10.0030.07013.65
5.3.00.0100.05713.75
5.2.170.0030.06311.18
5.2.160.0070.03311.04
5.2.150.0030.04711.16
5.2.140.0030.06711.08
5.2.130.0070.05011.23
5.2.120.0030.04011.13
5.2.110.0030.04711.17
5.2.100.0030.06311.14
5.2.90.0070.03711.05
5.2.80.0100.05311.20
5.2.70.0030.06710.99
5.2.60.0070.06011.18
5.2.50.0030.06010.94
5.2.40.0100.05711.00
5.2.30.0000.04011.00
5.2.20.0030.06311.01
5.2.10.0100.04710.79
5.2.00.0030.03710.59
5.1.60.0030.05310.05
5.1.50.0070.05010.01
5.1.40.0070.05010.02
5.1.30.0100.05010.34
5.1.20.0070.05310.35
5.1.10.0030.04710.15
5.1.00.0100.0509.93
5.0.50.0100.0408.62
5.0.40.0100.0178.48
5.0.30.0000.0408.23
5.0.20.0030.0338.29
5.0.10.0030.0238.27
5.0.00.0030.0578.25
4.4.90.0000.0237.99
4.4.80.0000.0377.99
4.4.70.0030.0337.99
4.4.60.0000.0377.99
4.4.50.0030.0337.99
4.4.40.0000.0477.99
4.4.30.0030.0307.99
4.4.20.0000.0337.99
4.4.10.0030.0377.99
4.4.00.0000.0537.99
4.3.110.0000.0207.99
4.3.100.0030.0377.99
4.3.90.0000.0237.99
4.3.80.0100.0277.99
4.3.70.0000.0337.99
4.3.60.0030.0337.99
4.3.50.0000.0177.99
4.3.40.0000.0407.99
4.3.30.0000.0177.99
4.3.20.0030.0337.99
4.3.10.0000.0207.99
4.3.00.0030.0277.99

preferences:
47.18 ms | 401 KiB | 5 Q