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 = [ '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.70.0040.01116.58
8.3.60.0070.01118.56
8.3.50.0130.00622.93
8.3.40.0040.01118.46
8.3.30.0090.00618.96
8.3.20.0040.00420.25
8.3.10.0000.00821.76
8.3.00.0040.00417.54
8.2.180.0100.01016.50
8.2.170.0110.00422.96
8.2.160.0080.00620.43
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00521.02
8.2.110.0090.00021.99
8.2.100.0080.00417.66
8.2.90.0040.00419.09
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0000.00818.03
8.2.30.0040.00418.00
8.2.20.0000.00817.61
8.2.10.0080.00017.91
8.2.00.0040.00417.49
8.1.280.0100.00725.92
8.1.270.0030.00523.92
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00923.91
8.1.230.0040.00719.15
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0030.00617.22
8.1.190.0050.00317.23
8.1.180.0030.00518.10
8.1.170.0000.00818.50
8.1.160.0040.00421.82
8.1.150.0040.00418.80
8.1.140.0030.00517.40
8.1.130.0030.00319.66
8.1.120.0000.00717.41
8.1.110.0030.00617.43
8.1.100.0070.00017.42
8.1.90.0060.00317.38
8.1.80.0040.00417.34
8.1.70.0000.00717.37
8.1.60.0040.00417.41
8.1.50.0050.00317.38
8.1.40.0030.00517.46
8.1.30.0040.00417.56
8.1.20.0030.00617.46
8.1.10.0000.00717.46
8.1.00.0060.00317.30
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0000.00718.37
8.0.270.0000.00817.23
8.0.260.0040.00417.11
8.0.250.0070.00016.90
8.0.240.0040.00416.88
8.0.230.0050.00316.91
8.0.220.0000.00716.83
8.0.210.0000.00716.75
8.0.200.0030.00316.91
8.0.190.0000.00716.88
8.0.180.0040.00416.75
8.0.170.0040.00416.84
8.0.160.0050.00516.82
8.0.150.0070.00016.77
8.0.140.0030.00416.67
8.0.130.0000.00513.19
8.0.120.0070.00316.79
8.0.110.0030.00516.75
8.0.100.0040.00416.65
8.0.90.0000.00816.66
8.0.80.0130.00716.89
8.0.70.0070.00016.85
8.0.60.0040.00416.65
8.0.50.0050.00316.82
8.0.30.0130.00616.89
8.0.20.0140.00617.40
8.0.10.0040.00416.97
8.0.00.0080.01016.69
7.4.330.0050.00015.00
7.4.320.0030.00316.35
7.4.300.0030.00616.54
7.4.290.0030.00316.59
7.4.280.0000.00716.45
7.4.270.0030.00316.45
7.4.260.0030.00316.45
7.4.250.0070.00016.46
7.4.240.0060.00116.45
7.4.230.0030.00316.44
7.4.220.0120.00616.65
7.4.210.0000.01516.64
7.4.200.0070.00016.36
7.4.160.0090.01216.41
7.4.150.0160.00317.40
7.4.140.0110.00717.86
7.4.130.0080.00816.36
7.4.120.0070.01016.54
7.4.110.0070.01016.57
7.4.100.0090.01516.47
7.4.90.0100.00716.41
7.4.80.0130.00719.39
7.4.70.0120.00316.59
7.4.60.0030.01316.39
7.4.50.0040.00416.27
7.4.40.0120.01216.34
7.4.30.0090.01316.40
7.4.00.0060.00914.74
7.3.330.0030.00313.19
7.3.320.0020.00212.98
7.3.310.0080.00016.05
7.3.300.0000.00716.04
7.3.290.0130.00616.15
7.3.280.0070.01016.19
7.3.270.0130.01017.40
7.3.260.0170.00016.48
7.3.250.0090.00916.21
7.3.240.0120.00616.11
7.3.230.0120.00916.39
7.3.210.0130.00316.28
7.3.200.0130.00719.39
7.3.190.0110.00716.31
7.3.180.0120.00316.29
7.3.170.0100.00716.32
7.3.160.0090.00916.12
7.3.120.0060.01214.70
7.3.110.0060.01014.92
7.3.100.0110.00414.74
7.3.90.0030.00914.64
7.3.80.0060.00914.90
7.3.70.0030.00914.76
7.3.60.0050.00514.73
7.3.50.0030.01414.37
7.3.40.0000.01214.80
7.3.30.0050.00514.68
7.3.20.0030.00616.62
7.3.10.0040.00416.70
7.3.00.0080.00716.40
7.2.330.0170.00516.48
7.2.320.0110.01116.29
7.2.310.0130.01016.41
7.2.300.0090.01516.52
7.2.290.0030.01516.34
7.2.250.0070.01315.00
7.2.240.0040.01414.83
7.2.230.0030.00915.03
7.2.220.0090.00314.74
7.2.210.0060.00914.98
7.2.200.0000.01314.59
7.2.190.0000.01114.91
7.2.180.0090.00014.64
7.2.170.0070.00714.88
7.2.130.0110.01116.71
7.2.120.0160.00816.62
7.2.110.0130.01016.44
7.2.100.0170.00316.57
7.2.90.0090.00616.71
7.2.80.0130.00616.48
7.2.70.0000.01616.77
7.2.60.0070.00716.56
7.2.50.0110.00716.73
7.2.40.0100.00716.71
7.2.30.0080.00816.80
7.2.20.0070.01416.33
7.2.10.0120.00616.64
7.2.00.0050.01017.91
7.1.330.0130.00315.76
7.1.320.0060.00915.46
7.1.310.0080.00415.27
7.1.300.0030.00615.58
7.1.290.0080.00315.60
7.1.280.0060.00915.37
7.1.270.0100.00715.64
7.1.260.0040.01115.70
7.1.250.0180.00315.38
7.1.240.0210.00315.49
7.1.230.0100.00615.53
7.1.220.0070.01015.73
7.1.210.0100.00715.51
7.1.200.0120.00315.52
7.1.190.0180.00015.39
7.1.180.0110.00715.46
7.1.170.0030.00915.55
7.1.160.0130.00315.53
7.1.150.0150.00315.56
7.1.140.0230.00015.59
7.1.130.0140.00315.62
7.1.120.0000.00915.53
7.1.110.0000.01315.58
7.1.100.0570.00515.57
7.1.90.0070.00715.60
7.1.80.0060.00615.26
7.1.70.0080.00416.43
7.1.60.0100.00917.54
7.1.50.0040.01416.17
7.1.40.0130.00315.32
7.1.30.0080.00815.28
7.1.20.0100.00715.36
7.1.10.0060.00615.42
7.1.00.0120.03718.92
7.0.330.0140.00515.22
7.0.320.0150.00315.48
7.0.310.0100.00315.23
7.0.300.0070.01015.10
7.0.290.0150.00315.15
7.0.280.0070.00715.30
7.0.270.0070.00715.28
7.0.260.0130.00315.25
7.0.250.0030.01015.13
7.0.240.0070.00714.93
7.0.230.0040.00815.15
7.0.220.0070.00715.52
7.0.210.0080.00315.23
7.0.200.0030.00715.69
7.0.190.0030.01015.06
7.0.180.0040.00714.95
7.0.170.0110.00015.16
7.0.160.0100.00315.21
7.0.150.0100.00715.36
7.0.140.0050.04018.56
7.0.130.0060.01015.33
7.0.120.0100.00915.25
7.0.110.0130.00415.14
7.0.100.0180.00415.39
7.0.90.0100.01014.89
7.0.80.0210.00015.18
7.0.70.0100.01015.15
7.0.60.0070.03017.58
7.0.50.0090.04516.48
7.0.40.0140.02716.52
7.0.30.0260.03216.68
7.0.20.0170.03216.71
7.0.10.0110.04016.57
7.0.00.0070.03716.65
5.6.380.0000.01813.89
5.6.370.0060.00913.89
5.6.360.0060.00614.36
5.6.350.0120.00314.48
5.6.340.0070.01013.86
5.6.330.0120.00013.99
5.6.320.0050.00914.11
5.6.310.0040.00814.13
5.6.300.0090.00314.14
5.6.290.0040.01114.32
5.6.280.0090.03717.64
5.6.270.0120.00414.05
5.6.260.0100.00314.18
5.6.250.0030.01414.13
5.6.240.0080.00614.11
5.6.230.0080.00614.11
5.6.220.0030.01014.14
5.6.210.0050.04717.41
5.6.200.0060.04616.15
5.6.190.0070.04817.26
5.6.180.0270.02717.32
5.6.170.0190.02317.22
5.6.160.0090.01817.54
5.6.150.0080.03516.11
5.6.140.0030.04816.29
5.6.130.0070.02316.08
5.6.120.0060.02617.62
5.6.110.0030.03717.45
5.6.100.0080.04117.61
5.6.90.0100.04017.56
5.6.80.0060.03317.27
5.6.70.0060.01213.84
5.6.60.0060.00914.03
5.6.50.0090.00914.13
5.6.40.0030.00614.23
5.6.30.0090.00314.23
5.6.20.0070.00713.92
5.6.10.0000.01414.07
5.6.00.0110.00814.11
5.5.380.0030.00711.60
5.5.370.0090.00311.60
5.5.360.0030.00511.60
5.5.350.0140.04116.02
5.5.340.0070.04514.78
5.5.330.0100.03416.01
5.5.320.0160.02515.90
5.5.310.0160.03715.92
5.5.300.0130.02314.79
5.5.290.0100.04014.80
5.5.280.0090.03816.18
5.5.270.0050.02516.20
5.5.260.0070.02716.29
5.5.250.0070.02816.04
5.5.240.0110.02415.88
5.5.230.0070.00311.60
5.5.220.0040.00811.60
5.5.210.0060.00611.60
5.5.200.0030.01011.60
5.5.190.0000.01011.60
5.5.180.0040.00711.60
5.5.170.0000.01111.60
5.5.160.0030.00611.60
5.5.150.0040.00411.60
5.5.140.0030.00611.60
5.5.130.0000.01011.60
5.5.120.0130.00011.60
5.5.110.0040.00711.60
5.5.100.0000.01311.60
5.5.90.0000.01011.60
5.5.80.0130.00011.60
5.5.70.0060.00611.60
5.5.60.0060.00411.60
5.5.50.0060.00411.60
5.5.40.0100.00011.60
5.5.30.0080.00011.60
5.5.20.0120.00311.60
5.5.10.0080.00811.60
5.5.00.0060.00611.60
5.4.450.0230.02215.38
5.4.440.0220.02115.46
5.4.430.0280.02315.51
5.4.420.0150.02215.57
5.4.410.0150.02215.46
5.4.400.0130.02115.38
5.4.390.0100.02515.38
5.4.380.0170.03715.22
5.4.370.0150.03215.21
5.4.360.0220.02515.15
5.4.350.0220.03215.19
5.4.340.0150.03315.06
5.4.330.0000.00811.60
5.4.320.0040.02512.06
5.4.310.0060.02612.05
5.4.300.0040.02612.06
5.4.290.0030.02312.05
5.4.280.0050.02212.00
5.4.270.0070.02112.00
5.4.260.0070.02912.00
5.4.250.0070.02212.00
5.4.240.0040.02512.00
5.4.230.0030.02312.00
5.4.220.0060.02412.00
5.4.210.0060.02412.00
5.4.200.0040.02512.00
5.4.190.0090.02112.00
5.4.180.0050.02312.00
5.4.170.0070.02012.00
5.4.160.0050.02212.00
5.4.150.0050.02012.00
5.4.140.0060.02411.84
5.4.130.0060.02511.84
5.4.120.0060.01911.82
5.4.110.0050.02211.81
5.4.100.0040.02011.81
5.4.90.0030.02511.81
5.4.80.0060.02011.81
5.4.70.0040.02111.81
5.4.60.0060.02111.81
5.4.50.0070.01911.81
5.4.40.0040.02511.80
5.4.30.0040.02111.80
5.4.20.0050.02111.80
5.4.10.0050.02111.80
5.4.00.0040.02111.55
5.3.290.0070.02212.20
5.3.280.0060.02112.16
5.3.270.0050.02312.16
5.3.260.0060.02612.16
5.3.250.0060.02012.16
5.3.240.0080.01912.16
5.3.230.0050.02212.16
5.3.220.0070.02112.14
5.3.210.0060.02812.14
5.3.200.0070.01912.14
5.3.190.0040.03012.14
5.3.180.0080.02112.14
5.3.170.0040.02412.13
5.3.160.0050.02312.14
5.3.150.0040.02212.14
5.3.140.0040.02212.13
5.3.130.0060.02512.13
5.3.120.0040.02312.13
5.3.110.0060.02212.13
5.3.100.0060.02111.87
5.3.90.0050.02311.86
5.3.80.0090.01911.85
5.3.70.0060.01811.85
5.3.60.0060.02111.85
5.3.50.0040.02311.82
5.3.40.0080.01911.82
5.3.30.0060.02111.80
5.3.20.0080.01511.69
5.3.10.0040.02011.67
5.3.00.0060.02311.67
5.2.170.0040.01610.41
5.2.160.0020.01810.41
5.2.150.0020.01810.41
5.2.140.0060.01810.41
5.2.130.0020.01810.39
5.2.120.0020.01810.39
5.2.110.0020.01910.39
5.2.100.0090.01510.39
5.2.90.0040.01710.39
5.2.80.0020.02010.39
5.2.70.0030.02010.39
5.2.60.0070.01610.37
5.2.50.0050.01910.35
5.2.40.0060.01910.34
5.2.30.0070.01710.33
5.2.20.0040.01910.32
5.2.10.0040.01810.28
5.2.00.0060.02110.21
5.1.60.0060.0129.85
5.1.50.0070.0129.85
5.1.40.0030.0159.84
5.1.30.0030.01610.01
5.1.20.0050.01510.03
5.1.10.0040.0199.88
5.1.00.0050.0159.89
5.0.50.0050.0139.13
5.0.40.0040.0129.06
5.0.30.0030.0188.96
5.0.20.0020.0138.94
5.0.10.0020.0148.93
5.0.00.0040.0198.93
4.4.90.0030.0138.19
4.4.80.0020.0158.18
4.4.70.0040.0088.18
4.4.60.0070.0098.18
4.4.50.0010.0138.19
4.4.40.0050.0138.16
4.4.30.0030.0108.18
4.4.20.0020.0118.22
4.4.10.0020.0108.22
4.4.00.0020.0148.18
4.3.110.0020.0108.13
4.3.100.0040.0078.13
4.3.90.0040.0088.12
4.3.80.0030.0158.09
4.3.70.0010.0118.12
4.3.60.0020.0108.12
4.3.50.0010.0148.11
4.3.40.0020.0148.07
4.3.30.0030.0087.45
4.3.20.0030.0097.44
4.3.10.0020.0097.42
4.3.00.0050.00913.75

preferences:
45.59 ms | 401 KiB | 5 Q