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.60.0070.00718.68
8.3.50.0110.00522.11
8.3.40.0110.01119.09
8.3.30.0110.01118.92
8.3.20.0040.00419.03
8.3.10.0060.00321.09
8.3.00.0080.00021.73
8.2.180.0100.01317.13
8.2.170.0070.00722.96
8.2.160.0130.00320.22
8.2.150.0000.00824.18
8.2.140.0140.00424.66
8.2.130.0000.01026.16
8.2.120.0000.01019.21
8.2.110.0060.00320.35
8.2.100.0080.00418.03
8.2.90.0080.00019.30
8.2.80.0030.00619.26
8.2.70.0030.00617.88
8.2.60.0030.00518.05
8.2.50.0040.00418.07
8.2.40.0050.00318.22
8.2.30.0000.00721.20
8.2.20.0040.00417.88
8.2.10.0040.00417.81
8.2.00.0060.00617.81
8.1.280.0130.00725.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0030.00722.64
8.1.230.0040.00721.04
8.1.220.0030.00518.77
8.1.210.0040.00418.90
8.1.200.0090.00317.36
8.1.190.0000.00817.53
8.1.180.0040.00418.10
8.1.170.0040.00418.67
8.1.160.0040.00418.98
8.1.150.0000.00918.79
8.1.140.0080.00017.51
8.1.130.0000.00717.81
8.1.120.0030.00717.63
8.1.110.0040.00417.50
8.1.100.0090.00017.53
8.1.90.0070.00017.65
8.1.80.0000.00717.60
8.1.70.0000.00717.63
8.1.60.0000.00917.71
8.1.50.0040.00417.63
8.1.40.0060.00317.70
8.1.30.0050.00317.74
8.1.20.0040.00417.73
8.1.10.0000.00717.72
8.1.00.0040.00417.63
8.0.300.0000.00719.89
8.0.290.0000.00817.14
8.0.280.0000.00718.39
8.0.270.0000.00717.34
8.0.260.0060.00016.84
8.0.250.0000.00717.01
8.0.240.0080.00017.15
8.0.230.0030.00617.02
8.0.220.0070.00017.04
8.0.210.0050.00216.92
8.0.200.0000.00717.14
8.0.190.0000.00717.12
8.0.180.0030.00517.11
8.0.170.0000.00817.11
8.0.160.0040.00416.96
8.0.150.0030.00616.95
8.0.140.0030.00517.04
8.0.130.0000.00713.47
8.0.120.0000.00717.00
8.0.110.0020.00517.11
8.0.100.0000.00816.91
8.0.90.0040.00416.87
8.0.80.0150.00316.93
8.0.70.0040.00416.92
8.0.60.0000.00716.95
8.0.50.0040.00416.98
8.0.30.0050.01417.41
8.0.20.0090.00917.40
8.0.10.0040.00416.94
8.0.00.0170.00616.87
7.4.330.0020.00216.80
7.4.320.0000.00916.58
7.4.300.0070.00016.71
7.4.290.0030.00316.79
7.4.280.0000.00716.56
7.4.270.0000.00816.62
7.4.260.0030.00313.52
7.4.250.0040.00416.79
7.4.240.0070.00016.71
7.4.230.0070.00016.72
7.4.220.0120.00916.75
7.4.210.0100.00516.84
7.4.200.0030.00516.70
7.4.190.0070.00016.77
7.4.160.0100.01016.83
7.4.150.0090.01017.40
7.4.140.0150.00317.86
7.4.130.0130.00516.82
7.4.120.0120.00616.69
7.4.110.0090.00916.79
7.4.100.0150.00616.68
7.4.90.0120.00616.76
7.4.80.0050.01219.39
7.4.70.0080.00916.78
7.4.60.0060.01016.86
7.4.50.0040.00416.66
7.4.40.0030.01322.77
7.4.30.0050.01316.77
7.4.00.0060.01015.37
7.3.330.0060.00013.34
7.3.320.0000.00713.32
7.3.310.0020.00516.43
7.3.300.0070.00016.39
7.3.290.0070.00716.53
7.3.280.0060.01216.50
7.3.270.0090.00817.40
7.3.260.0100.01018.24
7.3.250.0080.01116.69
7.3.240.0160.00016.88
7.3.230.0140.00316.58
7.3.210.0230.00016.90
7.3.200.0160.00619.39
7.3.190.0180.00316.64
7.3.180.0080.00816.62
7.3.170.0060.01216.86
7.3.160.0060.01216.73
7.3.120.0100.00715.08
7.3.10.0240.00716.75
7.3.00.0120.00916.79
7.2.330.0120.00616.65
7.2.320.0160.00317.05
7.2.310.0050.02016.87
7.2.300.0030.01516.74
7.2.290.0000.01516.77
7.2.130.0160.01217.05
7.2.120.0140.00716.87
7.2.110.0170.01116.99
7.2.100.0300.00716.93
7.2.90.0390.00417.00
7.2.80.0270.01117.06
7.2.70.0170.00716.82
7.2.60.0150.01117.03
7.2.50.0270.00316.85
7.2.40.0260.00416.77
7.2.30.0330.00016.83
7.2.20.0200.00716.91
7.2.10.0220.00816.79
7.2.00.0130.01318.43
7.1.250.0270.00315.98
7.1.200.0000.01015.74
7.1.100.0070.01018.63
7.1.70.0100.00017.49
7.1.60.0070.00317.63
7.1.50.0040.01817.13
7.1.00.0030.03322.36
7.0.200.0040.00717.03
7.0.140.0070.07022.23
7.0.60.0270.07721.64
7.0.50.0030.08317.91
7.0.40.0000.07720.20
7.0.30.0270.06720.08
7.0.20.0230.04320.07
7.0.10.0130.06020.09
7.0.00.0070.09320.13
5.6.280.0000.07720.78
5.6.210.0170.05320.61
5.6.200.0100.05018.19
5.6.190.0070.08320.64
5.6.180.0500.07320.48
5.6.170.0370.07720.52
5.6.160.0170.07320.61
5.6.150.0070.08318.18
5.6.140.0070.03718.14
5.6.130.0100.07018.17
5.6.120.0170.04020.87
5.6.110.0030.08720.89
5.6.100.0330.05721.11
5.6.90.0070.07321.01
5.6.80.0000.08320.36
5.5.350.0000.07720.44
5.5.340.0100.07018.09
5.5.330.0170.05320.40
5.5.320.0170.07320.27
5.5.310.0230.03320.34
5.5.300.0070.04318.01
5.5.290.0070.08317.92
5.5.280.0170.05020.70
5.5.270.0200.07020.86
5.5.260.0100.06720.97
5.5.250.0100.08320.69
5.5.240.0170.04020.29
5.4.450.0200.04719.55
5.4.440.0200.04019.40
5.4.430.0200.04019.16
5.4.420.0200.06019.40
5.4.410.0230.06019.33
5.4.400.0130.06719.13
5.4.390.0230.04718.84
5.4.380.0230.06319.05
5.4.370.0200.04019.07
5.4.360.0230.03318.84
5.4.350.0230.07019.19
5.4.340.0200.05319.20
5.4.320.0330.04719.03
5.4.310.0300.07019.09
5.4.300.0170.04318.94
5.4.290.0230.04319.16
5.4.280.0230.04718.97
5.4.270.0130.08019.23
5.4.260.0270.06319.14
5.4.250.0200.04719.05
5.4.240.0230.07018.82
5.4.230.0230.07018.86
5.4.220.0200.04319.05
5.4.210.0200.04718.83
5.4.200.0130.04319.13
5.4.190.0230.06719.07
5.4.180.0200.07018.98
5.4.170.0270.06719.18
5.4.160.0170.04019.11
5.4.150.0270.07019.04
5.4.140.0170.04316.35
5.4.130.0270.03016.52
5.4.120.0170.07716.71
5.4.110.0230.06716.36
5.4.100.0270.06316.28
5.4.90.0270.03316.28
5.4.80.0070.03716.43
5.4.70.0130.08016.48
5.4.60.0230.05316.33
5.4.50.0230.06316.25
5.4.40.0230.03316.42
5.4.30.0200.03316.42
5.4.20.0170.03716.50
5.4.10.0200.03716.51
5.4.00.0100.04315.90
5.3.290.0300.07014.58
5.3.280.0230.03314.50
5.3.270.0200.03714.54
5.3.260.0230.04314.62
5.3.250.0270.06314.52
5.3.240.0230.04314.70
5.3.230.0300.05014.75
5.3.220.0130.04314.56
5.3.210.0200.04714.69
5.3.200.0230.06014.55
5.3.190.0170.03714.63
5.3.180.0230.03014.56
5.3.170.0170.04014.54
5.3.160.0200.03714.63
5.3.150.0230.06314.54
5.3.140.0170.04714.79
5.3.130.0270.04014.64
5.3.120.0230.07714.48
5.3.110.0200.06314.80
5.3.100.0170.03714.12
5.3.90.0100.04314.25
5.3.80.0130.05714.11
5.3.70.0100.06713.95
5.3.60.0200.04314.16
5.3.50.0200.03313.96
5.3.40.0230.06314.00
5.3.30.0200.03313.93
5.3.20.0230.03013.93
5.3.10.0200.03013.80
5.3.00.0200.04713.56
5.2.170.0170.04311.24
5.2.160.0170.03311.08
5.2.150.0200.02311.16
5.2.140.0130.03011.23
5.2.130.0130.03011.09
5.2.120.0230.05311.34
5.2.110.0170.02711.09
5.2.100.0100.03311.20
5.2.90.0200.04011.09
5.2.80.0130.04711.18
5.2.70.0130.03311.16
5.2.60.0130.03011.06
5.2.50.0130.04311.03
5.2.40.0130.04711.13
5.2.30.0100.04010.94
5.2.20.0070.04311.22
5.2.10.0100.03010.84
5.2.00.0170.02710.65
5.1.60.0130.02010.13
5.1.50.0130.02310.16
5.1.40.0130.0309.98
5.1.30.0130.03310.32
5.1.20.0030.04310.26
5.1.10.0070.0339.97
5.1.00.0200.04710.20
5.0.50.0100.0208.63
5.0.40.0030.0238.33
5.0.30.0070.0338.31
5.0.20.0070.0238.20
5.0.10.0070.0178.07
5.0.00.0030.0708.07
4.4.90.0100.0278.07
4.4.80.0130.0108.07
4.4.70.0030.0408.07
4.4.60.0100.0278.07
4.4.50.0030.0238.07
4.4.40.0130.0478.07
4.4.30.0070.0338.07
4.4.20.0130.0308.07
4.4.10.0030.0238.07
4.4.00.0100.0408.07
4.3.110.0070.0208.07
4.3.100.0100.0308.07
4.3.90.0130.0208.07
4.3.80.0100.0408.07
4.3.70.0070.0138.07
4.3.60.0030.0178.07
4.3.50.0030.0178.07
4.3.40.0030.0278.07
4.3.30.0000.0178.07
4.3.20.0000.0178.07
4.3.10.0030.0178.07
4.3.00.0000.0178.07

preferences:
68.73 ms | 401 KiB | 5 Q