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) { 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)); $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.40.0040.01118.98
8.3.30.0070.00719.22
8.3.20.0050.00320.16
8.3.10.0080.00021.83
8.3.00.0040.00422.37
8.2.170.0120.00322.96
8.2.160.0120.00620.77
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0080.00018.00
8.2.110.0040.00420.46
8.2.100.0120.00019.82
8.2.90.0080.00018.28
8.2.80.0060.00318.05
8.2.70.0030.00617.75
8.2.60.0030.00518.05
8.2.50.0080.00018.07
8.2.40.0090.00018.34
8.2.30.0080.00018.04
8.2.20.0000.00818.02
8.2.10.0040.00418.03
8.2.00.0020.00517.96
8.1.270.0000.00822.19
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00322.16
8.1.230.0030.00720.89
8.1.220.0060.00317.79
8.1.210.0000.00818.95
8.1.200.0060.00317.38
8.1.190.0050.00317.54
8.1.180.0080.00018.79
8.1.170.0000.00918.77
8.1.160.0040.00421.97
8.1.150.0040.00418.75
8.1.140.0000.00717.53
8.1.130.0000.00717.83
8.1.120.0000.00817.64
8.1.110.0040.00417.58
8.1.100.0030.00317.66
8.1.90.0040.00417.61
8.1.80.0070.00017.58
8.1.70.0070.00017.55
8.1.60.0030.00517.63
8.1.50.0000.00917.66
8.1.40.0040.00417.59
8.1.30.0050.00517.82
8.1.20.0040.00417.87
8.1.10.0040.00417.73
8.1.00.0040.00417.56
8.0.300.0050.00320.22
8.0.290.0040.00417.04
8.0.280.0070.00018.54
8.0.270.0040.00417.30
8.0.260.0000.00616.99
8.0.250.0000.00817.25
8.0.240.0030.00317.24
8.0.230.0000.00717.22
8.0.220.0050.00317.12
8.0.210.0000.00716.99
8.0.200.0040.00417.07
8.0.190.0050.00217.19
8.0.180.0020.00517.15
8.0.170.0000.00717.14
8.0.160.0000.00817.18
8.0.150.0000.00717.03
8.0.140.0040.00417.13
8.0.130.0080.00013.54
8.0.120.0000.00816.98
8.0.110.0050.00317.05
8.0.100.0040.00417.23
8.0.90.0000.00717.02
8.0.80.0070.01017.09
8.0.70.0070.00016.90
8.0.60.0000.00717.11
8.0.50.0080.00016.98
8.0.30.0120.00717.14
8.0.20.0090.01117.49
8.0.10.0040.00417.13
8.0.00.0070.01116.87
7.4.330.0030.00315.00
7.4.320.0060.00016.84
7.4.300.0030.00316.77
7.4.290.0040.00416.83
7.4.280.0030.00316.73
7.4.270.0000.00716.88
7.4.260.0000.00716.82
7.4.250.0040.00416.77
7.4.240.0010.00716.69
7.4.230.0070.00016.64
7.4.220.0090.01016.66
7.4.210.0070.00816.83
7.4.200.0030.00316.64
7.4.190.0000.00716.87
7.4.160.0030.01416.59
7.4.150.0100.00717.40
7.4.140.0100.01017.86
7.4.130.0080.01116.78
7.4.120.0100.00816.74
7.4.110.0070.01016.62
7.4.100.0050.01316.65
7.4.90.0060.01216.68
7.4.80.0180.00419.39
7.4.70.0060.01016.70
7.4.60.0120.00616.80
7.4.50.0000.00916.82
7.4.40.0030.01022.77
7.4.30.0030.01216.84
7.4.00.0060.00615.44
7.3.330.0000.00613.45
7.3.320.0030.00313.51
7.3.310.0070.00016.60
7.3.300.0000.00716.64
7.3.290.0060.01016.61
7.3.280.0090.01116.61
7.3.270.0100.00717.40
7.3.260.0060.01916.78
7.3.250.0070.01116.76
7.3.240.0070.01416.56
7.3.230.0070.01016.44
7.3.210.0070.01516.45
7.3.200.0060.01219.39
7.3.190.0060.01616.82
7.3.180.0060.00916.82
7.3.170.0090.01016.66
7.3.160.0090.00616.66
7.3.120.0060.00915.37
7.2.330.0070.01416.79
7.2.320.0170.00016.91
7.2.310.0120.00616.87
7.2.300.0090.00916.97
7.2.290.0090.00616.84
7.2.60.0150.00417.15
7.2.00.0120.00319.85
7.1.200.0040.01115.97
7.1.100.0140.01417.99
7.1.70.0000.00817.54
7.1.60.0110.01419.82
7.1.50.0130.00917.21
7.1.00.0130.06722.35
7.0.200.0040.00416.93
7.0.140.0000.07721.96
7.0.100.0170.07320.16
7.0.90.0030.07019.99
7.0.80.0100.08319.98
7.0.70.0030.05319.92
7.0.60.0030.06720.03
7.0.50.0130.05720.21
7.0.40.0030.08020.13
7.0.30.0170.04319.95
7.0.20.0100.08320.04
7.0.10.0130.06720.14
7.0.00.0030.09019.98
5.6.280.0130.06321.16
5.6.250.0100.05320.61
5.6.240.0000.08720.64
5.6.230.0100.07320.73
5.6.220.0170.07320.74
5.6.210.0000.05320.78
5.6.200.0100.06321.07
5.6.190.0070.07021.09
5.6.180.0000.08721.12
5.6.170.0070.08021.05
5.6.160.0000.05321.09
5.6.150.0170.06721.04
5.6.140.0130.07721.04
5.6.130.0000.05721.10
5.6.120.0070.06720.96
5.6.110.0130.07021.04
5.6.100.0030.08321.01
5.6.90.0030.06020.97
5.6.80.0000.06720.41
5.6.70.0070.07720.41
5.6.60.0000.08320.56
5.6.50.0000.06720.39
5.6.40.0130.05320.50
5.6.30.0070.08020.32
5.6.20.0030.07320.44
5.6.10.0030.08320.45
5.6.00.0000.08720.35
5.5.380.0070.07720.48
5.5.370.0070.07320.42
5.5.360.0200.03320.35
5.5.350.0070.08320.38
5.5.340.0070.07320.79
5.5.330.0200.06320.93
5.5.320.0130.06720.74
5.5.310.0200.07020.92
5.5.300.0100.07720.81
5.5.290.0170.05320.63
5.5.280.0070.05020.74
5.5.270.0100.04320.88
5.5.260.0170.06020.87
5.5.250.0000.07320.46
5.5.240.0030.03720.15
5.5.230.0030.07720.25
5.5.220.0030.07020.31
5.5.210.0100.08020.12
5.5.200.0070.07320.22
5.5.190.0130.07320.12
5.5.180.0170.06720.26
5.5.160.0130.07020.19
5.5.150.0070.07720.23
5.5.140.0100.07320.13
5.5.130.0100.07720.19
5.5.120.0170.02320.27
5.5.110.0130.06720.22
5.5.100.0070.03720.13
5.5.90.0070.05019.95
5.5.80.0070.03720.07
5.5.70.0070.07720.16
5.5.60.0030.08020.06
5.5.50.0100.07720.16
5.5.40.0030.06720.15
5.5.30.0030.07020.06
5.5.20.0070.07319.93
5.5.10.0170.06319.97
5.5.00.0100.07319.98
5.4.450.0070.08319.49
5.4.440.0130.07019.51
5.4.430.0170.07019.41
5.4.420.0130.06719.44
5.4.410.0070.04319.07
5.4.400.0030.06019.09
5.4.390.0030.06019.14
5.4.380.0100.07319.07
5.4.370.0030.04019.09
5.4.360.0070.06319.13
5.4.350.0030.04319.21
5.4.340.0070.08019.12
5.4.320.0000.07718.87
5.4.310.0070.07319.13
5.4.300.0130.04719.18
5.4.290.0030.03319.04
5.4.280.0070.07019.16
5.4.270.0100.07319.03
5.4.260.0030.04019.04
5.4.250.0070.03719.17
5.4.240.0070.07019.08
5.4.230.0100.06719.09
5.4.220.0030.08019.02
5.4.210.0100.07019.11
5.4.200.0070.07319.17
5.4.190.0030.06319.04
5.4.180.0100.06319.11
5.4.170.0070.07719.04
5.4.160.0030.03719.03
5.4.150.0070.03319.01
5.4.140.0100.07016.45
5.4.130.0070.07716.31
5.4.120.0070.03316.31
5.4.110.0070.06016.28
5.4.100.0100.06016.41
5.4.90.0070.06716.50
5.4.80.0070.07016.34
5.4.70.0070.06016.32
5.4.60.0070.06316.41
5.4.50.0070.07016.29
5.4.40.0070.07316.37
5.4.30.0130.03716.27
5.4.20.0000.07316.36
5.4.10.0000.08016.29
5.4.00.0070.07015.93
5.3.290.0100.07014.66
5.3.280.0070.07714.57
5.3.270.0030.08014.70
5.3.260.0070.05314.54
5.3.250.0030.08014.68
5.3.240.0100.06314.61
5.3.230.0070.07014.54
5.3.220.0100.06714.71
5.3.210.0100.06714.71
5.3.200.0000.05314.56
5.3.190.0130.06314.64
5.3.180.0070.06314.60
5.3.170.0030.03714.54
5.3.160.0100.03014.66
5.3.150.0070.06714.64
5.3.140.0030.08314.48
5.3.130.0030.08014.54
5.3.120.0070.07714.49
5.3.110.0000.07014.54
5.3.100.0070.06714.08
5.3.90.0000.08014.10
5.3.80.0100.07014.16
5.3.70.0100.06314.04
5.3.60.0030.06714.04
5.3.50.0070.06713.95
5.3.40.0130.06313.84
5.3.30.0070.03014.03
5.3.20.0000.03713.59
5.3.10.0100.06313.55
5.3.00.0100.07013.77
5.2.170.0000.03311.07
5.2.160.0130.05311.27
5.2.150.0100.04311.25
5.2.140.0030.04711.21
5.2.130.0000.03011.16
5.2.120.0130.04711.17
5.2.110.0070.05311.17
5.2.100.0030.04311.25
5.2.90.0000.05011.03
5.2.80.0000.06711.11
5.2.70.0000.03011.00
5.2.60.0070.05011.08
5.2.50.0030.06310.89
5.2.40.0070.05311.02
5.2.30.0070.06011.10
5.2.20.0130.05010.96
5.2.10.0000.03010.86
5.2.00.0030.06010.85
5.1.60.0030.04310.02
5.1.50.0070.05010.04
5.1.40.0000.0539.82
5.1.30.0000.02710.41
5.1.20.0070.05310.42
5.1.10.0070.05010.20
5.1.00.0130.0479.96
5.0.50.0030.0439.81
5.0.40.0030.0339.81
5.0.30.0070.0509.81
5.0.20.0000.0439.81
5.0.10.0030.0439.81
5.0.00.0030.0639.81
4.4.90.0100.0279.81
4.4.80.0000.0139.81
4.4.70.0030.0279.81
4.4.60.0070.0309.81
4.4.50.0000.0379.81
4.4.40.0000.0439.81
4.4.30.0030.0309.81
4.4.20.0000.0379.81
4.4.10.0100.0239.81
4.4.00.0030.0509.81
4.3.110.0030.0339.81
4.3.100.0000.0379.81
4.3.90.0030.0109.81
4.3.80.0000.0509.81
4.3.70.0100.0239.81
4.3.60.0000.0379.81
4.3.50.0030.0309.81
4.3.40.0000.0309.81
4.3.30.0070.0239.81
4.3.20.0000.0209.81
4.3.10.0000.0239.81
4.3.00.0000.0239.81

preferences:
54.21 ms | 400 KiB | 5 Q