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, isset($this->$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.0160.00318.43
8.3.50.0120.00722.17
8.3.40.0080.00818.92
8.3.30.0060.01018.96
8.3.20.0030.00618.98
8.3.10.0040.00420.75
8.3.00.0040.00423.71
8.2.180.0040.01116.88
8.2.170.0140.00022.96
8.2.160.0100.01020.39
8.2.150.0070.00724.18
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0040.00420.14
8.2.110.0060.00322.34
8.2.100.0090.00317.97
8.2.90.0030.00519.27
8.2.80.0050.00317.97
8.2.70.0030.00517.75
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0080.00018.18
8.2.30.0040.00419.80
8.2.20.0040.00417.89
8.2.10.0000.00717.91
8.2.00.0050.00317.95
8.1.280.0090.01325.92
8.1.270.0050.00223.99
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00622.45
8.1.230.0070.00420.90
8.1.220.0050.00318.77
8.1.210.0050.00318.91
8.1.200.0040.00417.35
8.1.190.0040.00417.41
8.1.180.0070.00318.10
8.1.170.0000.00818.74
8.1.160.0040.00418.93
8.1.150.0070.00018.71
8.1.140.0000.00717.62
8.1.130.0030.00317.77
8.1.120.0070.00017.63
8.1.110.0040.00417.65
8.1.100.0060.00317.56
8.1.90.0080.00017.54
8.1.80.0000.00717.66
8.1.70.0030.00317.49
8.1.60.0030.00617.77
8.1.50.0030.00517.54
8.1.40.0040.00417.64
8.1.30.0000.00817.84
8.1.20.0030.00617.84
8.1.10.0040.00417.66
8.1.00.0040.00417.66
8.0.300.0000.00719.96
8.0.290.0060.00316.75
8.0.280.0030.00318.36
8.0.270.0000.00717.35
8.0.260.0030.00316.86
8.0.250.0070.00017.16
8.0.240.0060.00617.10
8.0.230.0000.00717.02
8.0.220.0030.00317.07
8.0.210.0070.00017.07
8.0.200.0070.00017.08
8.0.190.0000.00717.05
8.0.180.0000.00717.05
8.0.170.0040.00416.98
8.0.160.0030.00716.95
8.0.150.0100.00016.99
8.0.140.0000.00717.02
8.0.130.0030.00313.50
8.0.120.0000.00816.89
8.0.110.0000.00716.96
8.0.100.0070.00016.94
8.0.90.0040.00417.04
8.0.80.0060.00917.14
8.0.70.0040.00417.09
8.0.60.0080.00017.09
8.0.50.0040.00417.07
8.0.30.0090.01017.21
8.0.20.0130.00617.40
8.0.10.0050.00317.13
8.0.00.0070.01117.01
7.4.330.0000.00514.80
7.4.320.0030.00316.75
7.4.300.0030.00316.82
7.4.290.0030.00516.83
7.4.280.0000.00716.81
7.4.270.0070.00016.86
7.4.260.0000.00713.53
7.4.250.0000.00816.82
7.4.240.0040.00416.85
7.4.230.0000.00716.74
7.4.220.0160.00916.83
7.4.210.0070.00816.78
7.4.200.0040.00416.83
7.4.190.0030.00316.96
7.4.160.0090.01116.73
7.4.150.0060.01217.40
7.4.140.0080.01117.86
7.4.130.0100.00716.48
7.4.120.0100.00716.80
7.4.110.0140.01016.80
7.4.100.0100.00716.80
7.4.90.0060.01216.91
7.4.80.0110.00719.04
7.4.70.0110.01316.79
7.4.60.0100.00716.54
7.4.50.0000.00916.31
7.4.40.0100.00322.27
7.4.30.0090.00916.72
7.4.00.0030.01415.22
7.3.330.0000.00513.45
7.3.320.0030.00313.40
7.3.310.0000.00716.52
7.3.300.0000.00716.32
7.3.290.0060.01316.53
7.3.280.0110.00716.52
7.3.270.0180.00417.40
7.3.260.0100.01118.24
7.3.250.0170.00816.61
7.3.240.0110.00716.59
7.3.230.0080.00816.39
7.3.210.0040.01316.37
7.3.200.0070.01619.39
7.3.190.0120.00616.71
7.3.180.0060.01116.45
7.3.170.0100.00716.50
7.3.160.0090.01216.73
7.3.120.0060.01214.96
7.3.10.0030.00717.02
7.3.00.0030.00916.50
7.2.330.0070.01316.74
7.2.320.0060.01616.61
7.2.310.0090.00916.90
7.2.300.0140.00316.80
7.2.290.0130.00316.65
7.2.130.0080.00417.06
7.2.120.0040.00717.07
7.2.110.0030.01217.16
7.2.100.0080.00417.31
7.2.90.0060.00616.88
7.2.80.0090.00317.23
7.2.70.0060.00617.34
7.2.60.0080.00416.82
7.2.50.0040.00716.96
7.2.40.0090.00316.89
7.2.30.0060.00617.05
7.2.20.0070.00317.11
7.2.10.0040.00716.98
7.2.00.0060.00818.08
7.1.250.0000.00816.10
7.1.100.0100.00018.26
7.1.70.0040.00717.41
7.1.60.0120.01219.40
7.1.50.0040.01817.23
7.1.00.0030.04722.47
7.0.200.0000.01216.87
7.0.140.0070.07022.04
7.0.60.0070.08020.05
7.0.50.0100.07717.85
7.0.40.0000.04720.22
7.0.30.0270.08020.14
7.0.20.0370.06320.22
7.0.10.0070.08020.30
7.0.00.0030.05320.31
5.6.280.0030.07321.08
5.6.210.0100.07320.57
5.6.200.0070.03718.16
5.6.190.0130.05020.64
5.6.180.0330.07020.64
5.6.170.0370.07320.51
5.6.160.0100.05720.45
5.6.150.0070.03718.29
5.6.140.0070.05718.11
5.6.130.0130.07318.29
5.6.120.0030.06720.99
5.6.110.0030.08320.96
5.6.100.0000.07321.09
5.6.90.0030.04020.95
5.6.80.0070.03720.48
5.6.70.0370.06720.38
5.5.350.3470.04720.29
5.5.340.0030.07717.93
5.5.330.0070.05720.23
5.5.320.0370.06720.57
5.5.310.0300.07720.41
5.5.300.0030.04017.98
5.5.290.0170.07017.98
5.5.280.0100.08020.66
5.5.270.0100.05020.80
5.5.260.0130.06020.74
5.5.250.0030.04020.70
5.5.240.0100.04720.27
5.4.450.0070.04719.21
5.4.440.0030.04019.07
5.4.430.0730.04719.28
5.4.420.1730.04719.48
5.4.410.1770.04019.36
5.4.400.1600.03319.00
5.4.390.1770.04318.89
5.4.380.1500.04019.12
5.4.370.1530.04018.75
5.4.360.1500.04319.17
5.4.350.1030.04718.78
5.4.340.0030.04019.31
5.4.320.0000.05019.03
5.4.310.0300.04019.21
5.4.300.1430.04318.86
5.4.290.0270.04319.11
5.4.280.0170.05019.02
5.4.270.0200.03319.03
5.4.260.0130.04019.32
5.4.250.0100.04019.05
5.4.240.0270.03719.20
5.4.230.0200.04718.98
5.4.220.0200.03318.97
5.4.210.0170.03318.90
5.4.200.0170.03318.76
5.4.190.0170.03318.88
5.4.180.0230.03018.98
5.4.170.0170.04019.04
5.4.160.0270.02719.03
5.4.150.0100.04018.84
5.4.140.0230.04016.32
5.4.130.0100.04316.33
5.4.120.0200.03016.35
5.4.110.0100.04016.55
5.4.100.0130.03716.28
5.4.90.0130.03716.46
5.4.80.0130.03716.44
5.4.70.0130.04016.44
5.4.60.0200.03016.23
5.4.50.0170.03716.34
5.4.40.0130.03716.43
5.4.30.0170.03716.53
5.4.20.0100.03716.34
5.4.10.0130.05316.55
5.4.00.0130.03715.95
5.3.290.0200.03314.58
5.3.280.0130.03714.50
5.3.270.0370.03014.84
5.3.260.0300.05014.73
5.3.250.0170.03714.84
5.3.240.0230.03014.72
5.3.230.0130.04014.68
5.3.220.0070.04314.65
5.3.210.0100.03714.49
5.3.200.0200.03014.60
5.3.190.0130.04014.50
5.3.180.0130.03714.54
5.3.170.0100.04014.79
5.3.160.0130.03714.47
5.3.150.0170.03314.56
5.3.140.0130.03714.64
5.3.130.0100.05014.45
5.3.120.0030.04714.57
5.3.110.0230.04014.56
5.3.100.0130.03714.03
5.3.90.0200.04313.93
5.3.80.0130.03714.08
5.3.70.0200.04313.95
5.3.60.0230.04713.94
5.3.50.0130.05313.87
5.3.40.0100.04013.88
5.3.30.0200.04314.14
5.3.20.0130.03713.63
5.3.10.0200.03313.77
5.3.00.0270.03013.62
5.2.170.0070.04311.21
5.2.160.0130.02711.16
5.2.150.0170.02711.16
5.2.140.0100.03011.13
5.2.130.0130.02711.02
5.2.120.0130.02711.26
5.2.110.0070.03311.03
5.2.100.0130.03311.07
5.2.90.0100.03011.20
5.2.80.0100.03311.03
5.2.70.0100.03311.06
5.2.60.0100.03010.96
5.2.50.0170.02311.00
5.2.40.0100.02710.92
5.2.30.0070.05711.13
5.2.20.0030.05710.98
5.2.10.0100.03710.84
5.2.00.0130.04710.69
5.1.60.0200.0379.91
5.1.50.0130.0409.90
5.1.40.0130.05010.15
5.1.30.0130.02710.32
5.1.20.0100.05710.27
5.1.10.0170.05710.26
5.1.00.0100.03010.20
5.0.50.0100.0478.61
5.0.40.0100.0338.41
5.0.30.0030.0378.21
5.0.20.0070.0208.19
5.0.10.0030.0208.17
5.0.00.0070.0308.29
4.4.90.0100.0177.93
4.4.80.0070.0337.93
4.4.70.0100.0277.93
4.4.60.0100.0337.93
4.4.50.0070.0307.93
4.4.40.0100.0507.93
4.4.30.0100.0337.93
4.4.20.0030.0277.93
4.4.10.0100.0307.93
4.4.00.0070.0377.93
4.3.110.0030.0207.93
4.3.100.0000.0237.93
4.3.90.0030.0207.93
4.3.80.0000.0537.93
4.3.70.0070.0307.93
4.3.60.0030.0307.93
4.3.50.0000.0277.93
4.3.40.0030.0277.93
4.3.30.0030.0177.93
4.3.20.0200.0337.93
4.3.10.0200.0177.93
4.3.00.0270.0177.93

preferences:
54.06 ms | 401 KiB | 5 Q