3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FormBuilder { private function __construct() {} public static function build($form_attributes, $input_attributes) { $content = ''; foreach ($input_attributes as $key => $value) { $content = $content . '\n' + $this::buildInput($key, $value); } list($action, $method) = form_attributes; return $this::buildForm($content, $action, $method); } private static function buildInput($id, $name) { return "<div class=''> <label for='{$id}' class=''>{$name} <input type='text' name='{$name}' id='{$id}' class=''> </label> </div>"; } private static function buildForm($content, $action = '', $method = 'post') { return "<form action='{$action}' class='' method='{$method}'> {$content} </form>"; } private static function callback($key, $value) { buildInput($key, $value); } } $names = array( 'user' => 'Username', 'email' => 'Email', 'fname' => 'First Name', 'lname' => 'Last Name', 'pass' => 'Password', 'confirmedpass' => 'Confirmed Password' ); $form_attributes = [ 'action' => '', 'method' => 'post' ];

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.01018.03
8.3.50.0070.01222.82
8.3.40.0070.01118.46
8.3.30.0100.00318.97
8.3.20.0090.00020.31
8.3.10.0060.00321.71
8.3.00.0050.00317.80
8.2.180.0090.00616.32
8.2.170.0100.01022.96
8.2.160.0130.00020.48
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00420.98
8.2.110.0000.01022.19
8.2.100.0090.00317.72
8.2.90.0040.00419.23
8.2.80.0040.00417.97
8.2.70.0040.00417.62
8.2.60.0000.00917.80
8.2.50.0030.00518.07
8.2.40.0000.01018.14
8.2.30.0000.00817.98
8.2.20.0040.00417.50
8.2.10.0000.00717.99
8.2.00.0000.00717.49
8.1.280.0000.01425.92
8.1.270.0080.00023.91
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0060.00323.97
8.1.230.0040.00819.09
8.1.220.0000.00717.74
8.1.210.0040.00418.77
8.1.200.0040.00417.34
8.1.190.0050.00317.10
8.1.180.0000.00818.10
8.1.170.0080.00018.49
8.1.160.0070.00021.85
8.1.150.0000.00818.77
8.1.140.0030.00517.29
8.1.130.0000.00719.55
8.1.120.0000.00717.38
8.1.110.0060.00317.36
8.1.100.0000.00817.38
8.1.90.0040.00417.42
8.1.80.0000.00717.32
8.1.70.0030.00317.27
8.1.60.0030.00517.55
8.1.50.0040.00417.50
8.1.40.0030.00517.35
8.1.30.0030.00517.55
8.1.20.0000.00717.59
8.1.10.0060.00317.46
8.1.00.0040.00417.27
8.0.300.0040.00418.77
8.0.290.0050.00216.63
8.0.280.0030.00318.26
8.0.270.0040.00417.20
8.0.260.0000.00817.07
8.0.250.0070.00016.88
8.0.240.0070.00016.91
8.0.230.0000.00716.81
8.0.220.0000.00716.81
8.0.210.0030.00516.77
8.0.200.0030.00316.78
8.0.190.0040.00416.88
8.0.180.0070.00016.89
8.0.170.0070.00016.79
8.0.160.0060.00316.77
8.0.150.0070.00016.77
8.0.140.0040.00416.80
8.0.130.0000.00513.21
8.0.120.0040.00416.77
8.0.110.0030.00516.80
8.0.100.0000.00816.83
8.0.90.0030.00316.88
8.0.80.0090.00616.85
8.0.70.0000.00716.88
8.0.60.0040.00416.85
8.0.50.0030.00516.64
8.0.30.0120.00817.02
8.0.20.0100.00917.40
8.0.10.0040.00416.80
8.0.00.0080.00916.72
7.4.330.0000.00515.06
7.4.320.0030.00316.53
7.4.300.0050.00316.44
7.4.290.0030.00316.43
7.4.280.0000.00716.56
7.4.270.0000.00716.46
7.4.260.0040.00416.46
7.4.250.0030.00516.51
7.4.240.0070.00016.43
7.4.230.0000.00716.39
7.4.220.0140.00416.31
7.4.210.0100.00316.55
7.4.200.0040.00416.64
7.4.160.0120.00416.29
7.4.150.0090.00917.40
7.4.140.0110.00917.86
7.4.130.0100.00816.49
7.4.120.0090.00816.41
7.4.110.0220.01916.25
7.4.100.0090.00916.39
7.4.90.0030.01416.38
7.4.80.0060.01219.39
7.4.70.0100.00716.53
7.4.60.0000.01616.55
7.4.50.0040.00416.45
7.4.40.0050.01316.48
7.4.30.0080.00816.55
7.4.00.0070.00414.75
7.3.330.0050.00213.14
7.3.320.0050.00013.16
7.3.310.0000.00716.13
7.3.300.0000.00716.07
7.3.290.0080.00516.14
7.3.280.0070.01016.17
7.3.270.0060.01017.40
7.3.260.0070.01016.38
7.3.250.0090.00916.26
7.3.240.0130.01016.43
7.3.230.0070.01016.41
7.3.210.0070.01016.18
7.3.200.0110.00919.39
7.3.190.0070.01716.36
7.3.180.0090.00916.16
7.3.170.0100.00716.32
7.3.160.0100.00716.55
7.2.330.0100.01316.44
7.2.320.0120.00916.34
7.2.310.0130.00316.26
7.2.300.0030.01316.66
7.2.290.0130.00316.58
7.2.00.0140.00619.01
7.1.200.0070.00415.70
7.1.100.0810.00315.82
7.1.70.0080.00016.75
7.1.60.0070.01819.40
7.1.50.0110.01116.53
7.1.00.0030.07322.54
7.0.200.0000.00916.67
7.0.140.0030.06722.00
7.0.60.0070.04720.04
7.0.50.0070.04017.89
7.0.40.0130.07320.09
7.0.30.0430.07320.22
7.0.20.0200.09020.24
7.0.10.0000.09020.21
7.0.00.0030.04020.23
5.6.280.0000.07720.91
5.6.210.0100.06320.71
5.6.200.0100.07718.11
5.6.190.0030.09020.54
5.6.180.0230.04320.61
5.6.170.0200.04020.47
5.6.160.0030.04020.50
5.6.150.0030.08018.18
5.6.140.0100.07718.23
5.6.130.0070.05318.28
5.6.120.0070.05021.05
5.6.110.0130.08021.06
5.6.100.0070.07021.01
5.6.90.0000.09020.89
5.6.80.0030.03720.52
5.5.350.4130.03020.44
5.5.340.0170.07318.05
5.5.330.0130.07720.31
5.5.320.0470.06720.35
5.5.310.0300.07020.23
5.5.300.0030.05317.95
5.5.290.0070.05017.95
5.5.280.0070.06020.75
5.5.270.0130.07720.88
5.5.260.0100.07020.66
5.5.250.0070.04720.70
5.5.240.0230.07320.27
5.4.450.0100.04719.31
5.4.440.0470.03319.41
5.4.430.0470.04019.19
5.4.420.0200.03719.41
5.4.410.0200.05019.33
5.4.400.0500.04019.25
5.4.390.0970.04018.95
5.4.380.0200.05718.78
5.4.370.0400.04318.79
5.4.360.0300.05018.51
5.4.350.0300.05018.56
5.4.340.0430.04718.57
5.4.320.0070.04012.51
5.4.310.0190.06512.50
5.4.300.0070.06512.51
5.4.290.0120.05712.51
5.4.280.0090.05812.41
5.4.270.0150.04912.41
5.4.260.0120.05212.40
5.4.250.0130.04412.40
5.4.240.0250.08012.41
5.4.230.0170.05612.40
5.4.220.0070.07012.40
5.4.210.0090.04812.40
5.4.200.0200.05612.39
5.4.190.0090.05012.39
5.4.180.0110.05512.39
5.4.170.0090.05312.41
5.4.160.0080.05212.40
5.4.150.0110.04012.39
5.4.140.0060.04012.08
5.4.130.0070.04212.07
5.4.120.0090.03512.03
5.4.110.0050.03812.03
5.4.100.0060.05112.02
5.4.90.0090.05012.02
5.4.80.0080.04712.03
5.4.70.0080.04912.02
5.4.60.0070.03712.02
5.4.50.0090.03812.02
5.4.40.0060.03612.01
5.4.30.0040.04412.00
5.4.20.0090.03312.01
5.4.10.0110.03012.01
5.4.00.0050.03711.49
5.3.290.0100.04912.80
5.3.280.0050.03812.71
5.3.270.0070.04012.73
5.3.260.0060.04112.72
5.3.250.0090.03812.72
5.3.240.0090.03912.72
5.3.230.0110.03312.71
5.3.220.0100.03812.68
5.3.210.0110.03612.68
5.3.200.0090.03712.68
5.3.190.0090.04312.68
5.3.180.0100.04812.67
5.3.170.0080.04912.67
5.3.160.0130.04212.67
5.3.150.0090.04412.67
5.3.140.0110.04312.66
5.3.130.0090.05312.66
5.3.120.0100.05212.65
5.3.110.0110.05412.66
5.3.100.0040.06012.13
5.3.90.0070.03612.11
5.3.80.0060.03712.11
5.3.70.0080.04812.11
5.3.60.0050.03912.09
5.3.50.0100.03512.04
5.3.40.0100.04612.04
5.3.30.0070.04112.00
5.3.20.0070.03611.77
5.3.10.0070.04611.74
5.3.00.0030.04711.73
5.2.170.0060.0349.23
5.2.160.0050.0349.22
5.2.150.0040.0329.23
5.2.140.0050.0339.22
5.2.130.0040.0329.18
5.2.120.0080.0309.18
5.2.110.0040.0319.19
5.2.100.0130.0359.19
5.2.90.0070.0399.19
5.2.80.0050.0339.18
5.2.70.0040.0329.18
5.2.60.0040.0359.14
5.2.50.0070.0409.11
5.2.40.0060.0369.08
5.2.30.0040.0439.05
5.2.20.0040.0369.05
5.2.10.0060.0308.95
5.2.00.0060.0298.81
5.1.60.0070.0328.10
5.1.50.0070.0378.09
5.1.40.0060.0368.07
5.1.30.0090.0378.42
5.1.20.0040.0388.44
5.1.10.0090.0308.17
5.1.00.0040.0318.17
5.0.50.0030.0236.65
5.0.40.0030.0206.51
5.0.30.0030.0336.32
5.0.20.0030.0216.29
5.0.10.0010.0236.26
5.0.00.0070.0366.26
4.4.90.0020.0174.78
4.4.80.0050.0194.75
4.4.70.0060.0134.75
4.4.60.0010.0174.76
4.4.50.0040.0144.77
4.4.40.0020.0264.71
4.4.30.0050.0154.76
4.4.20.0020.0184.84
4.4.10.0040.0224.85
4.4.00.0020.0304.76
4.3.110.0020.0174.67
4.3.100.0030.0144.66
4.3.90.0050.0124.64
4.3.80.0030.0244.58
4.3.70.0020.0164.63
4.3.60.0010.0174.63
4.3.50.0040.0144.63
4.3.40.0040.0224.54
4.3.30.0010.0173.30
4.3.20.0020.0163.28
4.3.10.0020.0173.24
4.3.00.0100.01315.89

preferences:
42.21 ms | 401 KiB | 5 Q