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.1rc30.0080.00016.64
8.1rc20.0000.00716.80
8.1rc10.0000.00716.71
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.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:
11.65 ms | 455 KiB | 5 Q