3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class GalleryHelper { public static function getGalleryImages($type, $selectedFolder): array { $galleryImages = []; $folderToEquipmentImages = "images/equipmentmanager/$type/"; if($type === 'packages'){ $folderToEquipmentImages .= 'galleries/'; } $imgsPath = JPATH_SITE . '/' . $folderToEquipmentImages . $selectedFolder; if (is_dir($imgsPath)) { $allowedExtensions = ['jpg', 'jpeg', 'png', 'gif']; // see https://www.regular-expressions.info/modifiers.html and here is a sub-demonstration: https://3v4l.org/fKXcL $filter = "\.(?:(?i)" . implode('|', $allowedExtensions) . ")$"; // Prepend the folder path to the filenames (enjoying PHP7.4's arrow function syntax) $galleryImages = array_map( fn($img) => \JUri::base() . $folderToEquipmentImages . $selectedFolder . '/' . $img, Folder::files($imgsPath, $filter, false, false, $exclude = ['index.html']) ); } return $galleryImages; } }

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.00.0110.01119.89
8.4.150.0020.00014.05
8.4.140.0130.00717.58
8.4.130.0150.00517.78
8.4.120.0080.00820.47
8.4.110.0050.00522.41
8.4.100.0110.01017.37
8.4.90.0130.00818.63
8.4.80.0140.00717.74
8.4.70.0100.00517.76
8.4.60.0130.00818.70
8.4.50.0080.01320.05
8.4.40.0130.00624.27
8.4.30.0040.00418.81
8.4.20.0080.01217.76
8.4.10.0030.00624.17
8.3.280.0140.00618.05
8.3.270.0100.00916.45
8.3.260.0120.00816.48
8.3.250.0110.00818.60
8.3.240.0070.00316.70
8.3.230.0050.00316.54
8.3.220.0030.00616.98
8.3.210.0100.01016.71
8.3.200.0090.00316.67
8.3.190.0130.00817.07
8.3.180.0120.00616.53
8.3.170.0150.00418.65
8.3.160.0180.00017.23
8.3.150.0000.00816.95
8.3.140.0040.01116.64
8.3.130.0170.00316.61
8.3.120.0120.00320.77
8.3.110.0080.00016.41
8.3.100.0060.00316.28
8.3.90.0140.00726.77
8.3.80.0030.00616.63
8.3.70.0040.01416.63
8.3.60.0070.01518.31
8.3.50.0130.00318.41
8.3.40.0070.00720.26
8.3.30.0100.00618.67
8.3.20.0060.00324.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0130.00620.18
8.2.280.0090.00620.06
8.2.270.0060.01220.55
8.2.260.0040.00418.67
8.2.250.0090.00618.22
8.2.240.0060.00916.36
8.2.230.0000.00920.94
8.2.220.0040.00424.06
8.2.210.0040.00426.77
8.2.200.0070.00318.29
8.2.190.0140.00316.58
8.2.180.0120.00325.92
8.2.170.0060.00918.70
8.2.160.0110.00422.96
8.2.150.0020.00525.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00826.16
8.2.110.0090.00022.27
8.2.100.0080.00417.78
8.2.90.0000.00918.96
8.2.80.0050.00317.97
8.2.70.0060.00317.25
8.2.60.0050.00317.80
8.2.50.0040.00718.07
8.2.40.0080.00018.09
8.2.30.0030.00717.86
8.2.20.0080.00020.49
8.2.10.0000.00717.99
8.2.00.0000.00819.11
8.1.330.0100.00923.78
8.1.320.0050.01216.14
8.1.310.0030.01016.45
8.1.300.0060.00918.55
8.1.290.0030.00630.84
8.1.280.0160.00625.92
8.1.270.0070.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00923.82
8.1.230.0000.01219.14
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0080.00017.22
8.1.190.0060.00317.40
8.1.180.0040.00418.10
8.1.170.0040.00418.55
8.1.160.0000.00818.63
8.1.150.0070.00018.38
8.1.140.0040.00417.37
8.1.130.0020.00517.33
8.1.120.0000.00717.38
8.1.110.0070.01117.33
8.1.100.0060.00917.38
8.1.90.0040.00417.33
8.1.80.0030.00517.34
8.1.70.0030.00517.33
8.1.60.0000.00817.49
8.1.50.0000.01017.45
8.1.40.0070.00217.50
8.1.30.0050.01017.54
8.1.20.0070.00317.41
8.1.10.0100.00017.48
8.1.00.0070.00417.34
8.0.300.0000.00719.08
8.0.290.0070.00016.91
8.0.280.0070.00018.19
8.0.270.0040.00416.69
8.0.260.0090.00017.33
8.0.250.0000.01017.33
8.0.240.0060.00317.33
8.0.230.0050.00517.33
8.0.220.0110.00417.33
8.0.210.0000.01017.33
8.0.200.0070.00217.33
8.0.190.0070.00317.33
8.0.180.0000.00917.33
8.0.170.0030.00617.33
8.0.160.0070.00417.33
8.0.150.0070.01117.33
8.0.140.0140.00217.33
8.0.130.0080.00817.33
8.0.120.0130.00017.33
8.0.110.0000.00917.33
8.0.100.0060.00317.33
8.0.90.0050.00517.33
8.0.80.0130.00317.33
8.0.70.0150.00317.33
8.0.60.0180.00017.33
8.0.50.0130.00317.33
8.0.30.0130.00317.33
8.0.20.0180.00017.33
8.0.10.0130.00317.33

preferences:
30.01 ms | 403 KiB | 5 Q