3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Input { /** @var array $attributes */ private $attributes = []; /** * @param $key * @return mixed|string */ public function getAttribute($key) { return isset($this->attributes[$key]) ? $this->attributes[$key] : null; } /** * @param $key * @param $value * @return $this */ public function setAttribute($key, $value) { $this->attributes[$key] = $value; return $this; } /** * @param array $attributes * @return $this */ public function setAttributes(array $attributes) { $this->attributes = $attributes; return $this; } /** * @return array */ public function getAttributes() { return $this->attributes; } public function render() { $html = '<input '; foreach ($this->getAttributes() as $key => $val) { $html .= $key.'="'.$val.'" '; } $html .= '/>'; return $html; } } $input = new Input(); $input->setAttribute('id', 'pr_id') ->setAttribute('name', 'project_id') ->setAttribute('type', 'text'); echo $input->render();

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.5.10.0110.00716.68
8.5.00.0110.01020.13
8.4.150.0030.00014.05
8.4.140.0090.01317.48
8.4.130.0100.00917.68
8.4.120.0060.00822.38
8.4.110.0100.01018.92
8.4.100.0080.00817.81
8.4.90.0140.00820.81
8.4.80.0050.00317.86
8.4.70.0130.00917.83
8.4.60.0120.00819.09
8.4.50.0130.00719.75
8.4.40.0040.01119.46
8.4.30.0090.00019.42
8.4.20.0060.00317.74
8.4.10.0040.00419.57
8.3.280.0120.00918.41
8.3.270.0110.01016.85
8.3.260.0060.00316.75
8.3.250.0030.00618.85
8.3.240.0090.00016.75
8.3.230.0130.00716.77
8.3.220.0140.00419.13
8.3.210.0100.00916.52
8.3.200.0050.00416.81
8.3.190.0060.01017.28
8.3.180.0130.00716.44
8.3.170.0090.00916.98
8.3.160.0150.00318.31
8.3.150.0160.00320.77
8.3.140.0180.00016.92
8.3.130.0080.00018.28
8.3.120.0040.00420.61
8.3.110.0060.00620.94
8.3.100.0040.00418.59
8.3.90.0070.00726.77
8.3.80.0030.00616.38
8.3.70.0150.00418.18
8.3.60.0160.00716.25
8.3.50.0080.01116.54
8.3.40.0110.00718.96
8.3.30.0090.00618.85
8.3.20.0000.00720.21
8.3.10.0080.00022.04
8.3.00.0000.00823.53
8.2.290.0080.01316.84
8.2.280.0150.00918.44
8.2.270.0140.00417.13
8.2.260.0140.00420.07
8.2.250.0090.00016.67
8.2.240.0040.00418.95
8.2.230.0000.00822.58
8.2.220.0060.00324.06
8.2.210.0070.00726.77
8.2.200.0080.00018.29
8.2.190.0090.00618.58
8.2.180.0140.00716.63
8.2.170.0070.00722.96
8.2.160.0070.00720.53
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00319.13
8.2.110.0060.00321.11
8.2.100.0120.00017.98
8.2.90.0000.00819.34
8.2.80.0090.00017.97
8.2.70.0040.00417.75
8.2.60.0030.00618.05
8.2.50.0030.00618.22
8.2.40.0050.00320.42
8.2.30.0040.00419.42
8.2.20.0000.00818.05
8.2.10.0040.00418.13
8.2.00.0040.00418.13
8.1.330.0150.00416.26
8.1.320.0100.01016.28
8.1.310.0080.00018.54
8.1.300.0060.01217.76
8.1.290.0080.00030.84
8.1.280.0100.01025.92
8.1.270.0080.00021.88
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.98
8.1.230.0080.00320.35
8.1.220.0040.00417.78
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0050.00318.59
8.1.160.0040.00418.95
8.1.150.0070.00020.11
8.1.140.0020.00519.59
8.1.130.0000.00719.05
8.1.120.0070.00317.51
8.1.110.0040.00417.49
8.1.100.0000.00717.45
8.1.90.0040.00417.37
8.1.80.0080.00017.42
8.1.70.0000.00717.47
8.1.60.0040.00417.62
8.1.50.0000.00717.52
8.1.40.0000.00817.41
8.1.30.0000.00717.67
8.1.20.0040.00417.57
8.1.10.0040.00417.48
8.1.00.0040.00417.53
8.0.300.0000.00919.09
8.0.290.0000.00816.58
8.0.280.0000.00718.50
8.0.270.0000.00717.14
8.0.260.0070.00018.47
8.0.250.0000.00716.86
8.0.240.0070.00016.88
8.0.230.0000.00716.96
8.0.220.0030.00316.77
8.0.210.0000.00816.89
8.0.200.0030.00316.92
8.0.190.0000.00716.98
8.0.180.0040.00416.88
8.0.170.0000.00716.93
8.0.160.0000.00716.96
8.0.150.0030.00616.83
8.0.140.0040.00416.87
8.0.130.0030.00313.26
8.0.120.0000.00816.87
8.0.110.0000.00816.75
8.0.100.0030.00516.93
8.0.90.0000.00816.93
8.0.80.0030.01216.95
8.0.70.0000.00716.88
8.0.60.0030.00516.92
8.0.50.0000.00716.83
8.0.30.0120.00917.19
8.0.20.0080.01017.40
8.0.10.0040.00417.06
8.0.00.0040.01516.85
7.4.330.0050.00015.55
7.4.320.0000.00616.63
7.4.300.0030.00316.61
7.4.290.0000.00716.41
7.4.280.0030.00616.65
7.4.270.0030.00316.64
7.4.260.0070.00016.45
7.4.250.0070.00016.58
7.4.240.0050.00216.59
7.4.230.0000.00716.69
7.4.220.0070.00016.42
7.4.210.0030.01616.62
7.4.200.0050.00216.58
7.4.160.0090.01116.59
7.4.150.0080.00917.40
7.4.140.0110.00917.86
7.4.130.0180.00016.43
7.4.120.0090.01016.50
7.4.110.0100.00716.58
7.4.100.0190.00316.45
7.4.90.0090.00916.53
7.4.80.0090.01319.39
7.4.70.0140.00316.66
7.4.60.0040.01816.70
7.4.50.0070.01116.47
7.4.40.0130.01016.49
7.4.30.0040.01416.41
7.4.00.0100.00715.00
7.3.330.0030.00613.33
7.3.320.0000.00513.25
7.3.310.0040.00416.41
7.3.300.0000.00816.40
7.3.290.0090.00716.36
7.3.280.0100.00716.37
7.3.270.0170.00617.40
7.3.260.0140.00316.56
7.3.250.0050.01316.42
7.3.240.0090.00816.59
7.3.230.0070.01016.59
7.3.210.0060.01016.66
7.3.200.0070.01016.38
7.3.190.0100.01016.67
7.3.180.0090.00616.54
7.3.170.0090.00916.45
7.3.160.0120.00616.55
7.3.120.0000.01214.89
7.3.110.0070.01014.84
7.3.100.0030.01214.88
7.3.90.0030.01014.66
7.3.80.0060.00314.78
7.3.70.0070.00715.04
7.3.60.0110.00314.74
7.3.50.0030.00914.99
7.3.40.0090.00914.63
7.3.30.0030.01414.67
7.3.20.0000.00816.55
7.3.10.0100.00316.75
7.3.00.0000.00816.40
7.2.330.0130.00916.59
7.2.320.0040.01216.58
7.2.310.0140.00316.54
7.2.300.0080.01516.70
7.2.290.0080.00816.80
7.2.240.0100.00715.09
7.2.230.0030.00915.24
7.2.220.0030.01015.18
7.2.210.0060.00314.96
7.2.200.0030.01415.16
7.2.190.0080.00815.05
7.2.180.0030.01215.21
7.2.170.0030.01514.98
7.2.160.0090.00615.27
7.2.150.0090.00016.92
7.2.140.0070.00716.68
7.2.130.0040.00716.90
7.2.120.0070.00317.00
7.2.110.0070.00716.71
7.2.100.0030.01017.01
7.2.90.0080.00416.80
7.2.80.0000.00817.03
7.2.70.0060.00916.78
7.2.60.0070.00916.82
7.2.50.0030.01016.61
7.2.40.0030.01017.14
7.2.30.0090.00617.02
7.2.20.0000.01117.04
7.2.10.0060.00316.70
7.2.00.0060.00316.94
7.1.330.0090.00615.68
7.1.320.0030.00615.86
7.1.310.0040.00415.93
7.1.300.0080.00315.80
7.1.290.0090.00615.82
7.1.280.0090.00315.77
7.1.270.0030.01315.84
7.1.260.0030.01215.79
7.1.250.0040.00815.78
7.1.200.0000.01515.61
7.1.90.0030.01018.21
7.1.80.0030.00918.02
7.1.70.0040.00717.30
7.1.60.0180.01135.03
7.1.50.0130.01034.89
7.1.40.0230.01034.48
7.1.30.0070.01834.39
7.1.20.0220.00334.46
7.1.10.0060.00616.50
7.1.00.0050.00816.60
7.0.230.0000.01317.56
7.0.220.0030.01017.81
7.0.210.0040.01216.73
7.0.200.0000.01416.80
7.0.190.0040.00716.86
7.0.180.0040.00715.98
7.0.170.0060.00916.35
7.0.160.0040.00816.52
7.0.150.0030.00916.20
7.0.140.0060.00616.29
7.0.130.0030.00916.55
7.0.120.0000.01216.66
7.0.110.0030.01316.47
7.0.100.0070.01016.39
7.0.90.0070.01116.42
7.0.80.0060.00616.51
7.0.70.0000.01216.51
7.0.60.0040.00816.07
7.0.50.0000.01216.15
7.0.40.0030.00816.45
7.0.30.0060.00616.44
7.0.20.0040.00816.38
7.0.10.0090.00316.51
7.0.00.0000.01316.41

preferences:
174.62 ms | 403 KiB | 5 Q