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][0]); 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.0100.01016.75
8.3.50.0120.00622.08
8.3.40.0090.00618.72
8.3.30.0070.00719.17
8.3.20.0030.00520.34
8.3.10.0030.00623.61
8.3.00.0090.00020.84
8.2.180.0060.00916.63
8.2.170.0100.01022.96
8.2.160.0170.00320.47
8.2.150.0030.01024.18
8.2.140.0080.00824.66
8.2.130.0060.00326.16
8.2.120.0110.00322.31
8.2.110.0060.00320.52
8.2.100.0100.00319.83
8.2.90.0030.00519.22
8.2.80.0030.00617.97
8.2.70.0060.00317.63
8.2.60.0040.00418.03
8.2.50.0040.00418.07
8.2.40.0040.00420.00
8.2.30.0100.00018.35
8.2.20.0060.00319.74
8.2.10.0000.00718.07
8.2.00.0000.00917.97
8.1.280.0120.00425.92
8.1.270.0060.01323.95
8.1.260.0080.00026.35
8.1.250.0090.00028.09
8.1.240.0090.00021.17
8.1.230.0090.00317.55
8.1.220.0060.00317.76
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0080.00017.36
8.1.180.0060.00318.10
8.1.170.0030.00518.71
8.1.160.0000.00721.97
8.1.150.0030.00618.71
8.1.140.0040.00417.53
8.1.130.0000.00817.83
8.1.120.0000.00817.63
8.1.110.0040.00417.51
8.1.100.0040.00417.53
8.1.90.0040.00417.66
8.1.80.0000.00817.62
8.1.70.0080.00017.63
8.1.60.0060.00317.75
8.1.50.0030.00717.65
8.1.40.0090.00017.66
8.1.30.0060.00317.82
8.1.20.0030.00517.73
8.1.10.0080.00017.72
8.1.00.0040.00417.67
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00818.48
8.0.270.0080.00017.23
8.0.260.0060.00017.14
8.0.250.0000.00817.14
8.0.240.0040.00416.99
8.0.230.0070.00017.13
8.0.220.0030.00316.95
8.0.210.0050.00317.10
8.0.200.0000.00717.05
8.0.190.0030.00516.97
8.0.180.0040.00817.05
8.0.170.0080.00017.12
8.0.160.0000.00817.02
8.0.150.0060.00317.00
8.0.140.0040.00417.07
8.0.130.0060.00013.48
8.0.120.0040.00416.91
8.0.110.0000.00817.00
8.0.100.0000.00916.86
8.0.90.0000.00817.07
8.0.80.0030.01317.10
8.0.70.0000.00717.09
8.0.60.0030.00516.87
8.0.50.0000.00716.84
8.0.30.0030.01617.25
8.0.20.0110.00817.40
8.0.10.0050.00317.18
8.0.00.0120.00716.97
7.4.330.0050.00015.00
7.4.320.0030.00316.53
7.4.300.0030.00316.77
7.4.290.0040.00416.81
7.4.280.0000.00816.80
7.4.270.0040.00416.81
7.4.260.0000.00716.81
7.4.250.0030.00516.80
7.4.240.0010.00616.79
7.4.230.0070.00016.67
7.4.220.0060.01216.90
7.4.210.0080.00816.78
7.4.200.0000.00716.67
7.4.190.0030.00316.88
7.4.160.0130.00316.77
7.4.150.0120.00617.40
7.4.140.0130.00717.86
7.4.130.0090.00916.47
7.4.120.0120.00916.58
7.4.110.0000.01616.88
7.4.100.0220.00016.59
7.4.90.0080.01216.73
7.4.80.0120.00619.39
7.4.70.0060.01116.57
7.4.60.0120.00616.67
7.4.50.0000.00816.61
7.4.40.0070.01016.68
7.4.30.0100.00716.59
7.4.00.0040.01414.98
7.3.330.0060.00013.18
7.3.320.0050.00013.30
7.3.310.0000.00816.31
7.3.300.0000.00716.49
7.3.290.0090.00916.51
7.3.280.0070.01016.50
7.3.270.0140.00717.40
7.3.260.0140.00316.47
7.3.250.0130.00816.46
7.3.240.0110.00616.35
7.3.230.0070.01016.66
7.3.210.0140.00516.45
7.3.200.0090.00919.39
7.3.190.0110.01216.63
7.3.180.0060.01016.53
7.3.170.0030.01316.71
7.3.160.0110.00416.71
7.3.120.0080.00814.87
7.3.00.0130.00016.70
7.2.330.0120.01316.53
7.2.320.0080.01116.85
7.2.310.0090.00916.88
7.2.300.0170.00016.77
7.2.290.0150.00616.88
7.2.130.0060.00917.11
7.2.120.0070.00717.22
7.2.110.0030.00616.69
7.2.100.0070.00716.89
7.2.90.0000.01216.96
7.2.80.0090.00617.09
7.2.70.0080.00817.04
7.2.60.0040.00717.08
7.2.50.0000.01417.15
7.2.40.0000.01116.85
7.2.30.0030.01016.97
7.2.20.0000.01216.85
7.2.10.0030.00916.96
7.2.00.0030.01217.02
7.1.250.0100.00315.71
7.1.240.0040.00815.61
7.1.230.0100.00716.00
7.1.220.0070.00715.87
7.1.210.0090.00315.71
7.1.200.0090.00315.85
7.1.190.0100.00316.00
7.1.180.0030.01015.77
7.1.170.0000.01315.79
7.1.160.0060.00615.86
7.1.150.0040.00415.71
7.1.140.0060.00615.70
7.1.130.0030.01016.03
7.1.120.0050.00516.09
7.1.110.0000.01316.02
7.1.100.0050.00717.13
7.1.90.0030.00815.85
7.1.80.0030.00815.89
7.1.70.0000.01016.71
7.1.60.0050.01217.80
7.1.50.0080.00816.58
7.1.40.0030.00515.89
7.1.30.0060.00615.86
7.1.20.0080.00415.82
7.1.10.0030.00616.02
7.1.00.0040.04019.07
7.0.330.0060.00315.71
7.0.320.0040.00415.45
7.0.310.0040.00815.57
7.0.300.0070.00715.62
7.0.290.0060.00615.33
7.0.280.0060.00615.32
7.0.270.0030.00715.35
7.0.260.0120.00315.45
7.0.250.0000.01415.56
7.0.240.0040.00715.55
7.0.230.0140.00015.63
7.0.220.0110.00015.32
7.0.210.0060.00315.46
7.0.200.0050.00616.13
7.0.190.0000.01615.52
7.0.180.0030.01015.47
7.0.170.0090.00615.47
7.0.160.0000.01115.76
7.0.150.0070.00715.36
7.0.140.0050.03818.67
7.0.130.0000.01315.60
7.0.120.0000.00815.56
7.0.110.0030.01315.29
7.0.100.0070.00715.62
7.0.90.0030.00615.54
7.0.80.0040.00815.54
7.0.70.0040.02418.48
7.0.60.0020.03118.53
7.0.50.0080.02718.82
7.0.40.0050.02516.89
7.0.30.0070.02216.76
7.0.20.0050.02416.83
7.0.10.0030.02316.96
7.0.00.0010.03116.78
5.6.380.0100.00314.39
5.6.370.0080.00414.63
5.6.360.0060.00613.98
5.6.350.0000.00914.24
5.6.340.0000.00814.50
5.6.330.0030.00614.33
5.6.320.0110.00414.55
5.6.310.0080.00014.76
5.6.300.0040.00414.12
5.6.290.0100.00314.61
5.6.280.0030.04217.79
5.6.270.0000.01314.46
5.6.260.0070.00714.18
5.6.250.0090.00614.34
5.6.240.0060.00614.45
5.6.230.0040.00714.43
5.6.220.0000.02917.50
5.6.210.0020.02817.39
5.6.200.0020.02517.74
5.6.190.0040.02217.61
5.6.180.0020.01917.82
5.6.170.0120.01817.78
5.6.160.0010.02417.89
5.6.150.0050.02317.63
5.6.140.0050.02817.71
5.6.130.0070.04517.79
5.6.120.0090.04417.68
5.6.110.0080.03117.69
5.6.100.0030.03317.80
5.6.90.0030.04717.60
5.6.80.0050.04217.34
5.6.70.0040.04517.36
5.6.60.0080.03817.27
5.6.50.0100.04217.62
5.6.40.0060.04117.46
5.6.30.0030.04517.45
5.6.20.0040.03817.35
5.6.10.0070.03317.22
5.6.00.0000.03217.29
5.5.380.0030.00711.29
5.5.370.0090.00011.36
5.5.360.0020.02615.85
5.5.350.0030.03715.78
5.5.340.0020.02516.06
5.5.330.0040.02416.11
5.5.320.0000.02316.02
5.5.310.0060.01816.04
5.5.300.0010.02415.88
5.5.290.0020.02916.08
5.5.280.0030.02816.04
5.5.270.0060.02315.99
5.5.260.0060.02715.90
5.5.250.0030.03015.80
5.5.240.0050.04415.79
5.5.230.0040.04615.64
5.5.220.0060.03015.77
5.5.210.0070.02315.67
5.5.200.0080.04015.69
5.5.190.0050.04215.79
5.5.180.0030.03615.75
5.5.170.0070.00411.28
5.5.160.0070.03715.73
5.5.150.0050.02415.69
5.5.140.0060.04115.73
5.5.130.0080.03315.66
5.5.120.0050.04515.65
5.5.110.0030.04515.74
5.5.100.0070.03315.50
5.5.90.0050.04215.65
5.5.80.0080.04015.63
5.5.70.0030.04515.55
5.5.60.0070.04215.71
5.5.50.0120.03815.71
5.5.40.0020.04415.55
5.5.30.0070.04115.66
5.5.20.0090.03715.65
5.5.10.0100.03315.75
5.5.00.0080.03715.47
5.4.450.0030.04315.31
5.4.440.0050.04415.30
5.4.430.0060.03415.45
5.4.420.0010.02915.20
5.4.410.0030.04215.08
5.4.400.0060.03215.12
5.4.390.0120.03915.08
5.4.380.0080.04214.92
5.4.370.0120.02015.21
5.4.360.0090.03715.22
5.4.350.0060.04215.02
5.4.340.0020.04414.99
5.4.330.0000.00911.12
5.4.320.0060.02515.09
5.4.310.0030.02414.96
5.4.300.0060.02815.11
5.4.290.0110.03814.88
5.4.280.0080.03315.10
5.4.270.0030.04415.08
5.4.260.0040.04215.12
5.4.250.0020.04314.93
5.4.240.0020.02715.02
5.4.230.0070.04114.92
5.4.220.0030.04314.91
5.4.210.0110.03514.85
5.4.200.0030.04514.94
5.4.190.0030.04015.02
5.4.180.0080.04114.78
5.4.170.0080.03314.91
5.4.160.0090.03614.86
5.4.150.0050.02314.86
5.4.140.0070.03913.83
5.4.130.0070.03713.60
5.4.120.0050.04013.70
5.4.110.0070.02813.71
5.4.100.0050.02713.81
5.4.90.0070.03013.73
5.4.80.0020.03113.59
5.4.70.0050.02113.74
5.4.60.0070.03813.75
5.4.50.0000.02213.83
5.4.40.0020.03313.73
5.4.30.0020.02413.71
5.4.20.0070.03713.74
5.4.10.0060.03913.56
5.4.00.0020.03813.49
5.3.290.0060.02012.75
5.3.280.0070.02612.58
5.3.270.0040.04112.64
5.3.260.0010.03812.64
5.3.250.0050.03812.69
5.3.240.0000.04312.67
5.3.230.0060.04212.68
5.3.220.0030.04212.65
5.3.210.0040.03512.57
5.3.200.0030.04212.53
5.3.190.0080.03512.58
5.3.180.0030.04312.64
5.3.170.0050.03212.62
5.3.160.0000.02512.63
5.3.150.0030.02112.62
5.3.140.0020.02912.66
5.3.130.0000.03512.63
5.3.120.0030.03712.66
5.3.110.0070.03812.50
5.3.100.0050.03712.22
5.3.90.0030.04012.38
5.3.80.0020.04012.28
5.3.70.0020.03812.20
5.3.60.0020.04012.24
5.3.50.0020.04112.29
5.3.40.0020.03712.22
5.3.30.0030.03812.24
5.3.20.0020.02212.17
5.3.10.0000.03211.91
5.3.00.0020.04112.10
5.2.170.0020.03510.74
5.2.160.0030.03510.72
5.2.150.0020.02410.72
5.2.140.0030.02610.72
5.2.130.0020.02310.62
5.2.120.0050.02310.60
5.2.110.0020.01910.61
5.2.100.0020.03210.63
5.2.90.0020.03510.60
5.2.80.0000.03310.74
5.2.70.0050.02810.63
5.2.60.0090.03010.66
5.2.50.0040.02310.57
5.2.40.0000.03710.63
5.2.30.0020.02510.54
5.2.20.0000.02310.62
5.2.10.0050.02210.60
5.2.00.0000.03210.43
5.1.60.0040.01810.26
5.1.50.0040.02710.26
5.1.40.0050.02510.26
5.1.30.0060.02610.34
5.1.20.0010.03310.33
5.1.10.0070.02610.26
5.1.00.0050.02810.26
5.0.50.0020.02110.26
5.0.40.0040.02410.26
5.0.30.0050.02810.26
5.0.20.0060.02110.26
5.0.10.0000.02010.26
5.0.00.0000.03510.26
4.4.90.0020.02010.26
4.4.80.0010.01710.26
4.4.70.0020.01310.26
4.4.60.0000.02010.26
4.4.50.0030.01610.26
4.4.40.0040.03010.26
4.4.30.0060.01210.26
4.4.20.0040.02010.26
4.4.10.0060.01610.26
4.4.00.0020.03010.26
4.3.110.0000.02010.26
4.3.100.0010.01310.26
4.3.90.0030.01810.26
4.3.80.0050.02610.26
4.3.70.0000.02110.26
4.3.60.0020.01910.26
4.3.50.0000.01910.26
4.3.40.0020.02610.26
4.3.30.0000.02110.26
4.3.20.0020.01710.26
4.3.10.0000.02110.26
4.3.00.0010.02110.26

preferences:
43.77 ms | 401 KiB | 5 Q