3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* jobTitle.php Ideally, the model layer is used to access database data More directly generate the desired result array to be returned with loadColumn(): public function getOptions() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('jobtitle')->from('#__jobs'); return $db->setQuery($query)->loadColumn(); } Ideally, collecting submitted data should be done in the controller layer. Ideally, generating html markup should be done in the view layer. --- technologies.php Use loadResult(): $backend = $db->setQuery($query)->loadResult(); The foreach body can be simplified: foreach ($backend as $line) { $result[] = [$line, in_array($line, $currentBackend)]; } You don't need to increment your own counter. Employ D.R.Y. coding regarding the if block. sprintf() spares interpolation/concatenation. Again, I would rather this mark up be generated in the view layer. $html = '<fieldset id="jform_technologies" class="list checkboxes">'; foreach ($this->getOptions() as $i => [$line, $checked]) { $html .= sprintf( '<label for="%1$s" class="checkbox"> <input type="checkbox" id="%1$s" name="jform[technologies][]" value="%2$s"%3$s>%2$s </label>', 'jform_backend' . $i, $line, $checked ? ' checked' : '' ); } $html .= '</fieldset>'; return $html; */

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.0140.00718.28
8.3.50.0100.00718.00
8.3.40.0140.00318.60
8.3.30.0110.00318.72
8.3.20.0070.00024.18
8.3.10.0020.00524.66
8.3.00.0080.00026.16
8.2.180.0090.00625.92
8.2.170.0000.01518.68
8.2.160.0160.00322.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0080.00019.65
8.2.110.0060.00321.12
8.2.100.0040.00717.62
8.2.90.0040.00417.38
8.2.80.0000.00818.52
8.2.70.0080.00017.63
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0000.00919.76
8.2.30.0000.00717.98
8.2.20.0040.00417.80
8.2.10.0000.00719.14
8.2.00.0000.00819.11
8.1.280.0030.01725.92
8.1.270.0150.00023.77
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0040.00422.34
8.1.230.0080.00322.24
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0090.00017.23
8.1.190.0000.00717.11
8.1.180.0040.00418.10
8.1.170.0080.00018.46
8.1.160.0040.00418.72
8.1.150.0070.00018.66
8.1.140.0050.00318.75
8.1.130.0040.00420.02
8.1.120.0000.00717.32
8.1.110.0100.00017.23
8.1.100.0000.00717.29
8.1.90.0000.00817.22
8.1.80.0040.00417.30
8.1.70.0060.00017.33
8.1.60.0060.00317.43
8.1.50.0030.00617.39
8.1.40.0040.00417.27
8.1.30.0070.00017.43
8.1.20.0090.00017.55
8.1.10.0050.00317.38
8.1.00.0000.01117.27
8.0.300.0030.00618.77
8.0.290.0040.00416.58
8.0.280.0000.00718.30
8.0.270.0040.00417.83
8.0.260.0000.00618.49
8.0.250.0000.00716.72
8.0.240.0000.00816.89
8.0.230.0070.00016.84
8.0.220.0030.00316.67
8.0.210.0000.00716.76
8.0.200.0000.00616.82
8.0.190.0000.00816.71
8.0.180.0030.00516.65
8.0.170.0060.00316.73
8.0.160.0070.00016.78
8.0.150.0080.00016.76
8.0.140.0030.00716.62
8.0.130.0000.00613.27
8.0.120.0040.00416.75
8.0.110.0000.00716.70
8.0.100.0040.00416.64
8.0.90.0070.00016.74
8.0.80.0010.01716.78
8.0.70.0050.00316.76
8.0.60.0030.00516.55
8.0.50.0050.00216.79
8.0.30.0130.00316.88
8.0.20.0130.00616.97
8.0.10.0020.00516.77
8.0.00.0060.01216.60
7.4.330.0050.00015.55
7.4.320.0050.00316.50
7.4.300.0000.00616.35
7.4.290.0030.00316.48
7.4.280.0030.00516.29
7.4.270.0040.00416.33
7.4.260.0030.00313.18
7.4.250.0020.00516.34
7.4.240.0030.00316.30
7.4.230.0000.00716.41
7.4.220.0030.00316.36
7.4.210.0080.00616.45
7.4.200.0030.00316.54
7.4.130.0120.00615.80
7.4.120.0130.00616.28
7.4.110.0140.01016.02
7.4.100.0150.00916.05
7.4.90.0150.00315.80
7.4.80.0070.01016.32
7.4.70.0100.00616.55
7.4.60.0130.00416.42
7.4.50.0140.00416.34
7.4.40.0070.01016.16
7.4.30.0080.01516.38
7.4.20.0110.00616.21
7.4.10.0110.00715.88
7.4.00.0120.00616.01
7.3.330.0030.00316.08
7.3.320.0050.00312.96
7.3.310.0050.00316.05
7.3.300.0000.00616.07
7.3.290.0070.00916.12
7.3.260.0130.01016.36
7.3.250.0200.00015.95
7.3.240.0060.01115.87
7.3.230.0070.01015.94
7.3.220.0100.00716.30
7.3.210.0100.00715.96
7.3.200.0170.00016.35
7.3.190.0140.00316.00
7.3.180.0030.01416.25
7.3.170.0100.00716.34
7.3.160.0140.00916.07
7.3.150.0100.00716.21
7.3.140.0130.00616.08
7.3.130.0120.00416.20
7.3.120.0140.00316.22
7.3.110.0070.01016.33
7.3.100.0120.01116.17
7.3.90.0100.00716.08
7.3.80.0090.00916.03
7.3.70.0090.00916.14
7.3.60.0110.00516.08
7.3.50.0090.00916.03
7.3.40.0060.01015.92
7.3.30.0060.01215.99
7.3.20.0130.00616.08
7.3.10.0090.00915.91
7.3.00.0040.01515.97

preferences:
58.61 ms | 400 KiB | 5 Q