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); $method = strtolower($matches[1]); $this->$method($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.40.0110.00418.88
8.3.30.0090.00618.84
8.3.20.0000.00818.82
8.3.10.0140.00320.61
8.3.00.0000.00917.63
8.2.170.0120.00319.21
8.2.160.0200.00022.96
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00419.95
8.2.110.0040.00722.38
8.2.100.0090.00317.84
8.2.90.0050.00318.03
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0050.00317.93
8.2.50.0050.00318.07
8.2.40.0040.00418.16
8.2.30.0000.00718.11
8.2.20.0000.00717.70
8.2.10.0030.00619.52
8.2.00.0000.00717.67
8.1.270.0000.00824.66
8.1.260.0000.00826.35
8.1.250.0060.00328.09
8.1.240.0100.00022.17
8.1.230.0110.00021.03
8.1.220.0000.00817.78
8.1.210.0030.00618.77
8.1.200.0090.00017.47
8.1.190.0000.00817.39
8.1.180.0030.00518.10
8.1.170.0080.00018.58
8.1.160.0050.00218.84
8.1.150.0070.00018.80
8.1.140.0020.00517.55
8.1.130.0030.00317.86
8.1.120.0000.00717.56
8.1.110.0030.00517.44
8.1.100.0000.00717.46
8.1.90.0070.00017.59
8.1.80.0050.00317.58
8.1.70.0000.00817.46
8.1.60.0050.00517.64
8.1.50.0040.00417.65
8.1.40.0000.00817.76
8.1.30.0050.00317.77
8.1.20.0000.00817.80
8.1.10.0070.00017.72
8.1.00.0040.00417.54
8.0.300.0040.00420.03
8.0.290.0060.00316.63
8.0.280.0070.00018.41
8.0.270.0000.00717.11
8.0.260.0030.00316.79
8.0.250.0040.00416.95
8.0.240.0080.00017.08
8.0.230.0050.00317.08
8.0.220.0030.00316.93
8.0.210.0030.00516.89
8.0.200.0000.00717.07
8.0.190.0070.00017.07
8.0.180.0070.00016.93
8.0.170.0000.00917.02
8.0.160.0040.00417.00
8.0.150.0000.00817.02
8.0.140.0070.00316.95
8.0.130.0070.00013.43
8.0.120.0080.00016.94
8.0.110.0040.00416.86
8.0.100.0030.00616.89
8.0.90.0040.00416.77
8.0.80.0040.01116.92
8.0.70.0070.00016.79
8.0.60.0000.00716.79
8.0.50.0030.00516.88
8.0.30.0090.01017.21
8.0.20.0130.00817.53
8.0.10.0070.00017.05
8.0.00.0120.00616.97
7.4.330.0000.00513.11
7.4.320.0040.00416.76
7.4.300.0030.00316.66
7.4.290.0040.00416.66
7.4.280.0060.00316.74
7.4.270.0000.00716.86
7.4.260.0000.00613.62
7.4.250.0050.00316.73
7.4.240.0050.00316.72
7.4.230.0070.00016.66
7.4.220.0130.00716.58
7.4.210.0090.00816.78
7.4.200.0070.00016.63
7.4.190.0070.00016.95
7.4.160.0110.00716.84
7.4.150.0160.00716.82
7.4.140.0070.01516.75
7.4.130.0100.01216.88
7.4.120.0090.00816.66
7.4.110.0060.01416.72
7.4.100.0140.00416.50
7.4.90.0330.01016.69
7.4.80.0110.01116.60
7.4.70.0060.01016.54
7.4.60.0030.01416.53
7.4.50.0000.00916.58
7.4.40.0080.00516.59
7.4.30.0060.01116.85
7.4.00.0070.01014.67
7.3.330.0030.00313.24
7.3.320.0000.00613.44
7.3.310.0000.00716.37
7.3.300.0000.00716.52
7.3.290.0100.01016.51
7.3.280.0100.00716.50
7.3.270.0090.00916.37
7.3.260.0120.00616.77
7.3.250.0080.01316.69
7.3.240.0090.00916.52
7.3.230.0030.01416.68
7.3.210.0090.00916.81
7.3.200.0100.01419.39
7.3.190.0090.00916.65
7.3.180.0120.00416.82
7.3.170.0030.01416.88
7.3.160.0130.00316.37
7.3.120.0070.00714.73
7.3.10.0070.00716.73
7.3.00.0060.00816.73
7.2.330.0090.00916.83
7.2.320.0100.01316.95
7.2.310.0100.01016.69
7.2.300.0090.00916.48
7.2.290.0100.01316.75
7.2.130.0040.00417.06
7.2.120.0030.00617.08
7.2.110.0050.00716.90
7.2.100.0080.00817.09
7.2.90.0110.00417.14
7.2.80.0050.00816.97
7.2.70.0050.00717.05
7.2.60.0050.00617.09
7.2.50.0070.00716.84
7.2.40.0080.00616.91
7.2.30.0020.01116.94
7.2.20.0050.00916.82
7.2.10.0070.00816.96
7.2.00.0020.01017.83
7.1.250.0050.00715.87
7.1.240.0040.01116.19
7.1.230.0040.00416.16
7.1.220.0090.00015.47
7.1.210.0070.00715.99
7.1.200.0010.00816.00
7.1.190.0090.00315.96
7.1.180.0000.00715.84
7.1.170.0040.01115.75
7.1.160.0110.00015.93
7.1.150.0070.00715.69
7.1.140.0000.00816.06
7.1.130.0120.00315.79
7.1.120.0040.00815.69
7.1.110.0070.00715.97
7.1.100.0050.00517.01
7.1.90.0000.00815.96
7.1.80.0040.01115.82
7.1.70.0030.01016.65
7.1.60.0100.00817.71
7.1.50.0090.01116.45
7.1.40.0070.00716.05
7.1.30.0030.01015.98
7.1.20.0060.00915.94
7.1.10.0040.01116.11
7.1.00.0050.02919.19
7.0.330.0030.00615.30
7.0.320.0040.01115.44
7.0.310.0000.01315.27
7.0.300.0030.00915.55
7.0.290.0080.00415.63
7.0.280.0030.00915.26
7.0.270.0040.00415.32
7.0.260.0040.00715.48
7.0.250.0070.00315.79
7.0.240.0030.00915.67
7.0.230.0120.00315.62
7.0.220.0040.01215.31
7.0.210.0040.01115.45
7.0.200.0000.00815.99
7.0.190.0090.00615.63
7.0.180.0070.00715.39
7.0.170.0060.00615.48
7.0.160.0040.00715.39
7.0.150.0030.01015.62
7.0.140.0050.04118.75
7.0.130.0070.00715.59
7.0.120.0020.03118.82
7.0.110.0070.00715.51
7.0.100.0130.00015.54
7.0.90.0040.00415.43
7.0.80.0030.01015.37
7.0.70.0080.00415.52
7.0.60.0030.04317.55
7.0.50.0110.04016.62
7.0.40.0050.02816.88
7.0.30.0130.04616.81
7.0.20.0130.04816.95
7.0.10.0150.04516.85
7.0.00.0030.02616.98
5.6.380.0030.01014.31
5.6.370.0060.00314.93
5.6.360.0030.01014.54
5.6.350.0070.00414.27
5.6.340.0000.01114.63
5.6.330.0060.00914.19
5.6.320.0070.00714.54
5.6.310.0030.00614.08
5.6.300.0040.01114.71
5.6.290.0060.00614.40
5.6.280.0080.03717.73
5.6.270.0030.01314.25
5.6.260.0100.00614.75
5.6.250.0030.00914.08
5.6.240.0040.00414.75
5.6.230.0040.00714.44
5.6.220.0060.00914.30
5.6.210.0030.03217.51
5.6.200.0050.02416.33
5.6.190.0020.03117.35
5.6.180.0220.03417.23
5.6.170.0130.02917.33
5.6.160.0120.03217.40
5.6.150.0120.03416.29
5.6.140.0110.04316.37
5.6.130.0080.03416.21
5.6.120.0060.03817.70
5.6.110.0150.03317.59
5.6.100.0050.04517.69
5.6.90.0090.04017.73
5.6.80.0110.03317.30
5.6.70.2230.02117.43
5.6.60.0100.00314.34
5.6.50.0070.00714.43
5.6.40.0100.00314.64
5.6.30.0070.00714.41
5.6.20.0030.01014.52
5.6.10.0130.00014.24
5.6.00.0030.01014.22
5.5.380.0060.00311.18
5.5.370.0000.00911.22
5.5.360.0040.00411.18
5.5.350.0130.03615.84
5.5.340.0080.03014.60
5.5.330.0110.02615.83
5.5.320.0130.02815.78
5.5.310.0150.03715.75
5.5.300.0030.04414.57
5.5.290.0070.02714.74
5.5.280.0000.02716.06
5.5.270.0080.02115.96
5.5.260.0020.03716.12
5.5.250.0090.03216.04
5.5.240.0030.02115.67
5.5.230.0040.00411.18
5.5.220.0050.00511.40
5.5.210.0100.00311.19
5.5.200.0060.00611.18
5.5.190.0060.00611.26
5.5.180.0060.00311.32
5.5.170.0000.00711.18
5.5.160.0030.00511.20
5.5.150.0040.00811.21
5.5.140.0080.00411.18
5.5.130.0000.01011.18
5.5.120.0060.00611.23
5.5.110.0030.00911.18
5.5.100.0090.00311.18
5.5.90.0000.00711.36
5.5.80.0050.00511.18
5.5.70.0030.00911.18
5.5.60.0040.00411.18
5.5.50.0000.01111.18
5.5.40.0000.00911.22
5.5.30.0030.00511.18
5.5.20.0070.00011.21
5.5.10.0060.00611.18
5.5.00.0070.00311.28
5.4.450.0090.01815.18
5.4.440.0030.03615.45
5.4.430.0030.04315.33
5.4.420.0100.02315.35
5.4.410.0060.03815.22
5.4.400.0010.04015.21
5.4.390.0070.02515.01
5.4.380.0080.03315.13
5.4.370.0020.03115.29
5.4.360.0070.02715.23
5.4.350.0090.02515.06
5.4.340.0050.02215.21
5.4.330.0030.00711.34
5.4.320.0100.04015.17
5.4.310.0050.03015.16
5.4.300.0040.02815.16
5.4.290.0100.04015.20
5.4.280.0040.02415.02
5.4.270.0150.03315.02
5.4.260.0090.03215.01
5.4.250.0030.04315.09
5.4.240.0050.03615.16
5.4.230.0030.02515.12
5.4.220.0050.04315.07
5.4.210.0070.03815.01
5.4.200.0080.03815.05
5.4.190.0070.04015.01
5.4.180.0070.03015.14
5.4.170.0060.04015.06
5.4.160.0060.03915.15
5.4.150.0090.03315.14
5.4.140.0120.02213.78
5.4.130.0090.02913.79
5.4.120.0080.03513.76
5.4.110.0010.04613.83
5.4.100.0030.03613.81
5.4.90.0040.04013.85
5.4.80.0020.03813.79
5.4.70.0050.04013.85
5.4.60.0050.04013.72
5.4.50.0020.04613.84
5.4.40.0070.03713.74
5.4.30.0050.03813.83
5.4.20.0050.02313.76
5.4.10.0050.04013.98
5.4.00.0050.02713.62
5.3.290.0020.04112.95
5.3.280.0030.03112.91
5.3.270.0050.02712.90
5.3.260.0060.02612.89
5.3.250.0040.03712.90
5.3.240.0030.04012.91
5.3.230.0030.02912.88
5.3.220.0050.02812.89
5.3.210.0040.02712.90
5.3.200.0050.03612.88
5.3.190.0060.03812.88
5.3.180.0070.03112.87
5.3.170.0040.02712.87
5.3.160.0030.02312.95
5.3.150.0070.03712.87
5.3.140.0090.04012.95
5.3.130.0050.04312.89
5.3.120.0030.03912.87
5.3.110.0050.04212.89
5.3.100.0070.03512.61
5.3.90.0100.03812.64
5.3.80.0110.03312.65
5.3.70.0070.03712.60
5.3.60.0030.03912.54
5.3.50.0070.03812.56
5.3.40.0050.03612.54
5.3.30.0050.03012.55
5.3.20.0070.03712.45
5.3.10.0050.02112.46
5.3.00.0080.01612.41
5.2.170.0030.03211.19
5.2.160.0000.03411.18
5.2.150.0050.03111.14
5.2.140.0030.03411.20
5.2.130.0070.03011.15
5.2.120.0100.02011.17
5.2.110.0020.01911.22
5.2.100.0070.03011.09
5.2.90.0070.03011.15
5.2.80.0080.03011.22
5.2.70.0040.03211.22
5.2.60.0050.03211.10
5.2.50.0080.03211.17
5.2.40.0050.01811.17
5.2.30.0060.03111.06
5.2.20.0070.03011.07
5.2.10.0050.02511.02
5.2.00.0030.02110.91
5.1.60.0050.02710.62
5.1.50.0030.01510.62
5.1.40.0030.02810.58
5.1.30.0100.02210.84
5.1.20.0060.01710.79
5.1.10.0000.02910.63
5.1.00.0040.03210.58
5.0.50.0040.0209.88
5.0.40.0030.0199.83
5.0.30.0060.0319.74
5.0.20.0000.0279.66
5.0.10.0040.0179.63
5.0.00.0050.0329.68
4.4.90.0060.0169.49
4.4.80.0010.0119.49
4.4.70.0000.0159.49
4.4.60.0060.0069.49
4.4.50.0020.0139.49
4.4.40.0030.0209.49
4.4.30.0020.0139.49
4.4.20.0020.0189.49
4.4.10.0030.0129.49
4.4.00.0050.0289.49
4.3.110.0050.0109.49
4.3.100.0060.0119.49
4.3.90.0020.0169.49
4.3.80.0000.0279.49
4.3.70.0020.0139.49
4.3.60.0030.0179.49
4.3.50.0000.0219.49
4.3.40.0030.0279.49
4.3.30.0000.0239.49
4.3.20.0000.0129.49
4.3.10.0020.0209.49
4.3.00.0000.0169.49

preferences:
40.67 ms | 400 KiB | 5 Q