3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $myName; public function getMyName() { return $this->myName; } public function __set($key, $value) {var_dump($key, $value, property_exists($this, $key)); 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($this, $property, isset($this->$property)); $this->__set($property, $arguments[0]); } } } $test = new Test; $test->setMyName(25); var_dump($test->getMyName());

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.70.0090.00616.75
8.3.60.0120.00917.00
8.3.50.0130.00421.21
8.3.40.0070.00719.09
8.3.30.0110.00318.92
8.3.20.0080.00018.90
8.3.10.0040.00421.21
8.3.00.0030.00723.65
8.2.180.0120.00316.88
8.2.170.0170.00322.96
8.2.160.0180.00420.39
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0060.00321.12
8.2.110.0100.00021.17
8.2.100.0060.00618.03
8.2.90.0080.00018.16
8.2.80.0040.00420.01
8.2.70.0040.00417.88
8.2.60.0030.00618.00
8.2.50.0040.00417.88
8.2.40.0000.00819.65
8.2.30.0080.00019.98
8.2.20.0000.00717.84
8.2.10.0050.00317.92
8.2.00.0030.00517.85
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0000.01022.60
8.1.230.0030.00720.90
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0040.00417.48
8.1.190.0040.00417.34
8.1.180.0000.00818.10
8.1.170.0000.00817.62
8.1.160.0000.00718.93
8.1.150.0040.00418.74
8.1.140.0030.00517.48
8.1.130.0030.00317.86
8.1.120.0040.00417.68
8.1.110.0000.00717.60
8.1.100.0000.00717.68
8.1.90.0040.00417.64
8.1.80.0000.00717.62
8.1.70.0000.00717.62
8.1.60.0030.00617.66
8.1.50.0080.00017.55
8.1.40.0040.00417.68
8.1.30.0030.00517.77
8.1.20.0090.00017.82
8.1.10.0040.00417.64
8.1.00.0000.00817.56
8.0.300.0040.00420.02
8.0.290.0080.00016.88
8.0.280.0030.00318.49
8.0.270.0030.00317.21
8.0.260.0070.00016.89
8.0.250.0040.00417.13
8.0.240.0000.00917.09
8.0.230.0000.00817.08
8.0.220.0040.00417.07
8.0.210.0080.00017.08
8.0.200.0040.00417.06
8.0.190.0030.00417.11
8.0.180.0000.00917.00
8.0.170.0000.00817.05
8.0.160.0050.00216.97
8.0.150.0040.00417.00
8.0.140.0030.00517.02
8.0.130.0000.00613.44
8.0.120.0000.00717.01
8.0.110.0040.00416.88
8.0.100.0040.00417.03
8.0.90.0000.00716.99
8.0.80.0070.01017.09
8.0.70.0040.00417.12
8.0.60.0000.00717.00
8.0.50.0080.00017.04
8.0.30.0080.01117.36
8.0.20.0150.00317.43
8.0.10.0000.00817.13
8.0.00.0100.00917.03
7.4.330.0000.00615.11
7.4.320.0000.00616.87
7.4.300.0060.00016.65
7.4.290.0030.00316.86
7.4.280.0000.00716.65
7.4.270.0030.00616.79
7.4.260.0000.00613.49
7.4.250.0080.00016.81
7.4.240.0030.00316.82
7.4.230.0050.00216.63
7.4.220.0030.01216.88
7.4.210.0060.00916.85
7.4.200.0000.00716.55
7.4.190.0070.00016.77
7.4.160.0090.00616.72
7.4.150.0070.01017.40
7.4.140.0080.01017.86
7.4.130.0090.00816.75
7.4.120.0080.01216.69
7.4.110.0070.01116.78
7.4.100.0150.00416.77
7.4.90.0090.00916.79
7.4.80.0100.01419.37
7.4.70.0090.01516.76
7.4.60.0030.01316.73
7.4.50.0000.00516.71
7.4.40.0040.01122.27
7.4.30.0130.01016.77
7.4.00.0120.00614.89
7.3.330.0000.00613.50
7.3.320.0050.00313.51
7.3.310.0040.00416.58
7.3.300.0000.00716.38
7.3.290.0070.00716.55
7.3.280.0080.00816.54
7.3.270.0110.00817.40
7.3.260.0110.00918.24
7.3.250.0090.01016.62
7.3.240.0100.00716.48
7.3.230.0030.01316.76
7.3.210.0070.01016.69
7.3.200.0070.01219.39
7.3.190.0060.01216.88
7.3.180.0170.00017.00
7.3.170.0110.01216.84
7.3.160.0130.00916.86
7.3.120.0100.00715.19
7.2.330.0030.01416.77
7.2.320.0060.01316.88
7.2.310.0130.01016.71
7.2.300.0100.01017.01
7.2.290.0150.00816.78
7.2.00.0000.01619.86
7.1.100.0040.00818.23
7.1.70.0030.00517.50
7.1.60.0060.01019.40
7.1.50.0060.01817.31
7.1.00.0070.05322.38
7.0.200.0030.00616.99
7.0.140.0030.07722.09
7.0.60.0000.03321.66
7.0.50.0000.04022.19
7.0.40.0000.03320.19
7.0.30.0000.03720.15
7.0.20.0030.05020.10
7.0.10.0070.07720.10
7.0.00.0130.07720.07
5.6.280.0070.07321.08
5.6.210.0000.03320.55
5.6.200.0000.03720.97
5.6.190.0000.03321.05
5.6.180.0030.04321.03
5.6.170.0000.03321.03
5.6.160.0100.07721.00
5.6.150.0070.06721.09
5.6.140.0000.06320.98
5.6.130.0030.08321.15
5.6.120.0000.05721.11
5.6.110.0070.03720.95
5.6.100.0070.08321.11
5.6.90.0070.07320.98
5.6.80.0070.07720.41
5.6.70.0070.07020.38
5.6.60.0030.07720.37
5.6.50.0130.06720.39
5.6.40.0000.08320.49
5.6.30.0030.08020.40
5.6.20.0100.07720.37
5.6.10.0030.07720.38
5.6.00.0000.06020.50
5.5.350.0030.03320.35
5.5.340.0000.03320.88
5.5.330.0070.03720.82
5.5.320.0000.03320.79
5.5.310.0000.03320.88
5.5.300.0070.07720.78
5.5.290.0030.08020.81
5.5.280.0070.05720.88
5.5.270.0100.04720.88
5.5.260.0130.06720.77
5.5.250.0070.07020.72
5.5.240.0030.08020.37
5.5.230.0030.07720.32
5.5.220.0030.07320.34
5.5.210.0000.08720.15
5.5.200.0030.05720.25
5.5.190.0100.07720.20
5.5.180.0070.05320.13
5.5.160.0030.07020.13
5.5.150.0030.07320.13
5.5.140.0030.06020.13
5.5.130.0000.07720.13
5.5.120.0100.06720.33
5.5.110.0070.07020.04
5.5.100.0100.07020.12
5.5.90.0030.08019.99
5.5.80.0130.06320.10
5.5.70.0070.08020.13
5.5.60.0100.07320.01
5.5.50.0100.07020.03
5.5.40.0030.07719.96
5.5.30.0000.04720.18
5.5.20.0030.04020.04
5.5.10.0000.04019.97
5.5.00.0070.07320.05
5.4.450.0030.08019.40
5.4.440.0000.05019.49
5.4.430.0070.07719.39
5.4.420.0100.07019.38
5.4.410.0030.06719.21
5.4.400.0030.08019.05
5.4.390.0030.08019.01
5.4.380.0000.06719.05
5.4.370.0100.06719.17
5.4.360.0030.03719.19
5.4.350.0100.06318.91
5.4.340.0000.05719.05
5.4.320.0000.05018.91
5.4.310.0000.04319.05
5.4.300.0070.07318.91
5.4.290.0000.04719.16
5.4.280.0000.07719.01
5.4.270.0070.07019.20
5.4.260.0070.07018.92
5.4.250.0070.07019.06
5.4.240.0030.08019.05
5.4.230.0070.08019.04
5.4.220.0070.06719.01
5.4.210.0000.08319.07
5.4.200.0030.07718.90
5.4.190.0000.04018.91
5.4.180.0030.03318.90
5.4.170.0070.07719.16
5.4.160.0070.05319.00
5.4.150.0100.07318.89
5.4.140.0130.06016.42
5.4.130.0030.04316.44
5.4.120.0100.06716.34
5.4.110.0070.04016.36
5.4.100.0000.06716.36
5.4.90.0000.07016.51
5.4.80.0070.06716.36
5.4.70.0070.07016.43
5.4.60.0030.07316.36
5.4.50.0000.06716.34
5.4.40.0030.07316.50
5.4.30.0100.04316.32
5.4.20.0070.07016.33
5.4.10.0070.07016.40
5.4.00.0000.07715.86
5.3.290.0100.03014.73
5.3.280.0070.07714.71
5.3.270.0070.03314.71
5.3.260.0000.08014.62
5.3.250.0070.07314.67
5.3.240.0000.04314.66
5.3.230.0070.06314.68
5.3.220.0030.08014.67
5.3.210.0030.07714.65
5.3.200.0030.05014.61
5.3.190.0030.07014.48
5.3.180.0070.07314.48
5.3.170.0030.08014.67
5.3.160.0030.08014.53
5.3.150.0030.07714.66
5.3.140.0030.06714.64
5.3.130.0030.06314.66
5.3.120.0030.08014.48
5.3.110.0000.07714.61
5.3.100.0030.07014.10
5.3.90.0030.07014.04
5.3.80.0070.07014.13
5.3.70.0000.07714.13
5.3.60.0030.08014.02
5.3.50.0000.08013.81
5.3.40.0030.07014.01
5.3.30.0000.06713.77
5.3.20.0030.07313.76
5.3.10.0100.06313.77
5.3.00.0030.07013.63
5.2.170.0100.05711.14
5.2.160.0030.06311.20
5.2.150.0000.06011.21
5.2.140.0100.05711.14
5.2.130.0030.05711.01
5.2.120.0030.06311.17
5.2.110.0000.06011.16
5.2.100.0070.05711.11
5.2.90.0070.05311.13
5.2.80.0000.05711.20
5.2.70.0000.04710.96
5.2.60.0000.05711.11
5.2.50.0000.03011.08
5.2.40.0000.02710.99
5.2.30.0000.03010.98
5.2.20.0030.05311.09
5.2.10.0030.04710.72
5.2.00.0000.03710.63
5.1.60.0030.02310.41
5.1.50.0070.05010.41
5.1.40.0030.05010.41
5.1.30.0130.04310.41
5.1.20.0000.05710.41
5.1.10.0070.05010.41
5.1.00.0000.06010.41
5.0.50.0030.03310.41
5.0.40.0070.02710.41
5.0.30.0030.05310.41
5.0.20.0030.02710.41
5.0.10.0070.04310.41
5.0.00.0000.06710.41
4.4.90.0030.01710.41
4.4.80.0030.01710.41
4.4.70.0000.03710.41
4.4.60.0000.02310.41
4.4.50.0030.01710.41
4.4.40.0000.02310.41
4.4.30.0000.03010.41
4.4.20.0000.03010.41
4.4.10.0000.03010.41
4.4.00.0000.05710.41
4.3.110.0030.02710.41
4.3.100.0000.04010.41
4.3.90.0000.03310.41
4.3.80.0000.04710.41
4.3.70.0000.03710.41
4.3.60.0000.03710.41
4.3.50.0030.03010.41
4.3.40.0030.05010.41
4.3.30.0030.02710.41
4.3.20.0000.03010.41
4.3.10.0000.03710.41
4.3.00.0000.01710.41

preferences:
43.74 ms | 401 KiB | 5 Q