3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Generating Gallery Vieuw * * Generating a simple gallery overview, * with Planned !possible extended MySQL Description support * * PHP Version 5 * * @category Gallery/Images * @author Diederick Bruin DDABruin@gmail.com * @copyright 2014 http://DiederickBruin.nl/ * */ class Gallery { private $MySQL_Host, $MySQL_Database, $MySQL_User, $MySQL_Password, $MySQL_Table; public static function GenerateCSS($folder = "img/",$imgclass = "fotodiv") { foreach(glob($folder."*.{jpg,png,gif,jpeg,ico}", GLOB_BRACE) as $Path) { $Bestand = str_replace($folder, "", $Path);//stip folder $Bestand = str_replace(".", "_", $Bestand);//remove dots to genereate classname $rstring .= ".img_$Bestand:hover + .desc_$Bestand"; $rstring .= "{display: block;} \n"; /*$rstring .= ".desc_$Bestand:hover + .desc_$Bestand"; //unnuset figure out howto code $rstring .= "{display: block;} \n";*/ } return $rstring; } public static function Generate($folder = "img/",$imgclass = "fotodiv") { foreach(glob($folder."*.{jpg,png,gif,jpeg,ico}", GLOB_BRACE) as $Path) { $Bestand = str_replace($folder, "", $Path); $Bestand = str_replace(".", "_", $Bestand); $rstring .= '<div class="'.$imgclass.'">'; $rstring .= '<img class="img_'.$Bestand.'" src="'.$Path.'">'; $rstring .= '<div class="desc_'.$Bestand.'"><p>'.$Bestand.'</p></div></div>';// functie GDescription gebruiken om de beschrijving te krijgen } return $rstring; } /** * * Hieronder niet afgemaakt */ private function GDescription($Path) //private omdat hij alleen binnen de class word gebruikt om de description te vullen voor nu { //$Bestand = str_replace("img/", "", $Path); haal met path uit database $MySQL_Connect = mysqli_connect($MySQL_Host, $MySQL_User, $MySQL_Password, $MySQL_Database); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($MySQL_Connect,"SELECT * FROM `$MySQL_Table` WHERE File = '$Path'"); $rstring = mysqli_fetch_array($result); mysqli_close($MySQL_Connect); return $rstring['Description']; } } ?>

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.40.0150.00018.39
8.3.30.0100.00319.04
8.3.20.0060.00320.30
8.3.10.0000.00822.17
8.3.00.0000.01022.48
8.2.170.0110.00422.96
8.2.160.0060.00920.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00926.16
8.2.120.0000.00819.23
8.2.110.0140.00322.30
8.2.100.0090.00619.51
8.2.90.0040.00419.05
8.2.80.0000.00817.97
8.2.70.0040.00417.38
8.2.60.0000.00917.93
8.2.50.0000.00818.07
8.2.40.0040.00417.96
8.2.30.0060.00317.90
8.2.20.0000.00817.57
8.2.10.0080.00019.34
8.2.00.0000.00717.48
8.1.270.0030.00622.06
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0070.00323.71
8.1.230.0100.00019.10
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0000.01017.11
8.1.190.0000.00817.38
8.1.180.0100.00018.10
8.1.170.0000.00818.57
8.1.160.0060.00321.96
8.1.150.0040.00418.57
8.1.140.0040.00417.34
8.1.130.0030.00517.82
8.1.120.0030.00317.24
8.1.110.0070.00317.23
8.1.100.0000.00717.26
8.1.90.0050.00317.28
8.1.80.0030.00317.25
8.1.70.0000.00717.27
8.1.60.0030.00617.39
8.1.50.0040.00417.30
8.1.40.0080.00017.37
8.1.30.0040.00417.36
8.1.20.0060.00317.48
8.1.10.0000.00717.37
8.1.00.0000.00817.35
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0040.00418.33
8.0.270.0000.00717.19
8.0.260.0080.00016.74
8.0.250.0030.00316.91
8.0.240.0030.00616.80
8.0.230.0030.00316.81
8.0.220.0030.00516.68
8.0.210.0030.00616.73
8.0.200.0040.00416.88
8.0.190.0080.00016.86
8.0.180.0030.00316.83
8.0.170.0000.00816.75
8.0.160.0040.00416.71
8.0.150.0000.00716.75
8.0.140.0040.00416.78
8.0.130.0000.00513.25
8.0.120.0080.00314.94
8.0.110.0040.00814.90
8.0.100.0090.00314.94
8.0.90.0080.00614.91
8.0.80.0080.00814.94
8.0.70.0040.00615.03
8.0.60.0070.00514.83
8.0.50.0070.00414.94
8.0.30.0120.01015.62
8.0.20.0120.00616.01
8.0.10.0100.00115.05
8.0.00.0110.00815.50
7.4.330.0050.00015.00
7.4.320.0000.00616.47
7.4.300.0070.00016.39
7.4.290.0030.00516.47
7.4.280.0030.00316.40
7.4.270.0040.00416.50
7.4.260.0070.00016.47
7.4.250.0120.00014.77
7.4.240.0040.00615.30
7.4.230.0120.00014.85
7.4.220.0170.00514.72
7.4.210.0120.00615.59
7.4.200.0080.00314.74
7.4.190.0070.00414.79
7.4.180.0120.00213.22
7.4.160.0140.00214.79
7.4.150.0090.00715.30
7.4.140.0120.00516.26
7.4.130.0100.00815.35
7.4.120.0120.00515.23
7.4.110.0070.01114.70
7.4.100.0110.00614.84
7.4.90.0110.00614.72
7.4.80.0140.00316.16
7.4.70.0130.00314.69
7.4.60.0100.00614.67
7.4.50.0060.00414.62
7.4.40.0080.00617.82
7.4.30.0100.00614.63
7.4.20.0110.00412.99
7.4.10.0000.01413.02
7.4.00.0080.00914.27
7.3.330.0000.00613.16
7.3.320.0030.00313.14
7.3.310.0050.00514.56
7.3.300.0070.00414.63
7.3.290.0130.00314.66
7.3.280.0120.00715.42
7.3.270.0090.00515.24
7.3.260.0110.00614.74
7.3.250.0090.00815.20
7.3.240.0090.00714.68
7.3.230.0060.00614.75
7.3.220.0000.00812.81
7.3.210.0140.00114.67
7.3.200.0090.00616.13
7.3.190.0100.00714.54
7.3.180.0090.00914.62
7.3.170.0090.00714.70
7.3.160.0090.00614.78
7.3.150.0100.00512.95
7.3.140.0170.00012.88
7.3.130.0160.00012.96
7.3.120.0060.01014.09
7.3.110.0090.00713.90
7.3.100.0130.00113.90
7.3.90.0070.00514.02
7.3.80.0090.00613.90
7.3.70.0090.00713.78
7.3.60.0060.00713.99
7.3.50.0090.00713.94
7.3.40.0060.00813.99
7.3.30.0080.00713.93
7.3.20.0060.00815.84
7.3.10.0100.00515.63
7.3.00.0120.00416.10
7.2.340.0160.00012.90
7.2.330.0130.00814.58
7.2.320.0110.00814.71
7.2.310.0100.00514.83
7.2.300.0130.00414.61
7.2.290.0050.01414.70
7.2.280.0150.00013.09
7.2.270.0090.00612.90
7.2.260.0120.00213.05
7.2.250.0130.00514.04
7.2.240.0060.01113.91
7.2.230.0070.00914.04
7.2.220.0090.00713.97
7.2.210.0090.00613.88
7.2.200.0080.00714.09
7.2.190.0070.00913.72
7.2.180.0060.00814.12
7.2.170.0110.00513.98
7.2.160.0030.00513.09
7.2.150.0020.00714.88
7.2.140.0040.00515.08
7.2.130.0070.01115.96
7.2.120.0130.00715.81
7.2.110.0110.00415.71
7.2.100.0100.00515.87
7.2.90.0050.00915.90
7.2.80.0130.00315.78
7.2.70.0020.01415.85
7.2.60.0100.00615.68
7.2.50.0090.00615.91
7.2.40.0100.00415.97
7.2.30.0100.00415.89
7.2.20.0120.00315.91
7.2.10.0060.00715.88
7.2.00.0080.00516.95
7.1.330.0090.00514.77
7.1.320.0060.00614.69
7.1.310.0070.00814.90
7.1.300.0050.01014.75
7.1.290.0110.00414.73
7.1.280.0060.00814.83
7.1.270.0090.00514.83
7.1.260.0070.00814.89
7.1.250.0090.00514.82
7.1.240.0090.00614.63
7.1.230.0110.00614.93
7.1.220.0060.00614.69
7.1.210.0100.00514.88
7.1.200.0070.00514.96
7.1.190.0070.00314.73
7.1.180.0100.00314.82
7.1.170.0120.00214.87
7.1.160.0120.00014.79
7.1.150.0110.00414.72
7.1.140.0100.00314.64
7.1.130.0080.00614.78
7.1.120.0020.00614.87
7.1.110.0070.00614.79
7.1.100.0070.00614.77
7.1.90.0130.00014.75
7.1.80.0070.00714.94
7.1.70.0050.00615.54
7.1.60.0060.00815.55
7.1.50.0100.00715.47
7.1.40.0040.00814.65
7.1.30.0060.00714.90
7.1.20.0120.00214.65
7.1.10.0050.00814.70
7.1.00.0070.02817.35
7.0.330.0120.00314.52
7.0.320.0080.00714.59
7.0.310.0040.01014.59
7.0.300.0050.00714.47
7.0.290.0090.00414.52
7.0.280.0080.00614.45
7.0.270.0090.00314.38
7.0.260.0090.00614.63
7.0.250.0100.00214.74
7.0.240.0110.00114.72
7.0.230.0050.00814.70
7.0.220.0100.00314.63
7.0.210.0110.00414.71
7.0.200.0080.00615.15
7.0.190.0110.00714.56
7.0.180.0080.00514.63
7.0.170.0070.00414.70
7.0.160.0080.00414.46
7.0.150.0080.00514.71
7.0.140.0060.02816.92
7.0.130.0080.00714.72
7.0.120.0070.00714.63
7.0.110.0090.00614.53
7.0.100.0170.00014.55
7.0.90.0060.01014.60
7.0.80.0120.00214.43
7.0.70.0110.00414.50
7.0.60.0080.03216.39
7.0.50.0050.03315.66
7.0.40.0100.02715.81
7.0.30.0200.02715.80
7.0.20.0160.02415.72
7.0.10.0140.03215.80
7.0.00.0120.02515.70
5.6.400.0080.00512.50
5.6.390.0110.00412.59
5.6.380.0030.01013.56
5.6.370.0060.00613.33
5.6.360.0110.00313.38
5.6.350.0040.00913.24
5.6.340.0100.00313.41
5.6.330.0060.00713.30
5.6.320.0100.00413.47
5.6.310.0070.00613.04
5.6.300.0110.00113.19
5.6.290.0060.00813.31
5.6.280.0050.02915.74
5.6.270.0110.00513.25
5.6.260.0110.00413.30
5.6.250.0080.00413.37
5.6.240.0050.00613.52
5.6.230.0080.00313.29
5.6.220.0090.00613.22
5.6.210.0090.01415.92
5.6.200.0060.02314.85
5.6.190.0070.01815.83
5.6.180.1460.01615.77
5.6.170.0160.03015.87
5.6.160.0070.03415.79
5.6.150.0050.03114.97
5.6.140.0080.01715.00
5.6.130.0060.02914.89
5.6.120.0070.03115.87
5.6.110.0080.03115.95
5.6.100.0100.02915.87
5.6.90.0100.02615.80
5.6.80.0070.02915.59
5.6.70.1370.01515.73
5.6.60.0100.00313.49
5.6.50.0080.00413.17
5.6.40.0080.00513.27
5.6.30.0060.00613.25
5.6.20.0040.00613.18
5.6.10.0070.00813.36
5.6.00.0080.00313.24
5.5.380.0060.00711.67
5.5.370.0060.00411.68
5.5.360.0080.00611.69
5.5.350.0180.02714.53
5.5.340.0050.02013.82
5.5.330.0060.03414.49
5.5.320.0140.03014.67
5.5.310.0140.01614.63
5.5.300.0050.01613.66
5.5.290.0080.03013.71
5.5.280.0090.03114.63
5.5.270.0050.02214.59
5.5.260.0070.02514.65
5.5.250.0070.02914.73
5.5.240.0050.02214.42
5.5.230.0080.00511.73
5.5.220.0070.00611.49
5.5.210.0100.00011.69
5.5.200.0070.00511.50
5.5.190.0050.00811.48
5.5.180.0050.00611.71
5.5.170.0050.00511.64
5.5.160.0100.00211.57
5.5.150.0090.00311.64
5.5.140.0080.00211.39
5.5.130.0100.00311.58
5.5.120.0070.00311.31
5.5.110.0070.00311.58
5.5.100.0040.00711.71
5.5.90.0070.00611.69
5.5.80.0020.00811.64
5.5.70.0080.00111.63
5.5.60.0080.00311.56
5.5.50.0080.00311.58
5.5.40.0050.00511.48
5.5.30.0050.00511.61
5.5.20.0050.00511.62
5.5.10.0060.00511.62
5.5.00.0050.00611.65
5.4.450.0130.02014.32
5.4.440.0300.02214.36
5.4.430.0320.01814.27
5.4.420.0070.02314.13
5.4.410.0140.02014.14
5.4.400.0150.03013.98
5.4.390.0160.02113.79
5.4.380.0060.02713.99
5.4.370.0060.01614.01
5.4.360.0070.02113.95
5.4.350.0090.01811.57
5.4.340.0060.01711.75
5.4.330.0080.00311.41
5.4.320.0080.01311.90
5.4.310.0070.01511.96
5.4.300.0080.01611.92
5.4.290.0090.01211.94
5.4.280.0070.01611.81
5.4.270.0080.02013.99
5.4.260.0090.02513.91
5.4.250.0070.02414.03
5.4.240.0080.02114.05
5.4.230.0100.01913.94
5.4.220.0060.02213.93
5.4.210.0070.02613.99
5.4.200.0080.02013.89
5.4.190.0100.02313.97
5.4.180.0060.02714.04
5.4.170.0080.02314.00
5.4.160.0070.02213.94
5.4.150.0080.02414.09
5.4.140.0080.02413.23
5.4.130.0060.02013.18
5.4.120.0070.02913.20
5.4.110.0040.02113.22
5.4.100.0050.02113.16
5.4.90.0090.02113.21
5.4.80.0060.02313.15
5.4.70.0050.02213.21
5.4.60.0050.02113.28
5.4.50.0040.02713.14
5.4.40.0080.02413.23
5.4.30.0080.01813.27
5.4.20.0050.02313.08
5.4.10.0070.02313.25
5.4.00.0090.01813.06
5.3.290.0070.01412.00
5.3.280.0080.02512.43
5.3.270.0090.01912.57
5.3.260.0080.02312.59
5.3.250.0100.02712.61
5.3.240.0090.01912.57
5.3.230.0070.02612.56
5.3.220.0090.02012.55
5.3.210.0070.02712.50
5.3.200.0110.02312.45
5.3.190.0070.02112.45
5.3.180.0080.02512.58
5.3.170.0030.02412.64
5.3.160.0060.02012.53
5.3.150.0100.02312.57
5.3.140.0110.02112.57
5.3.130.0090.02512.42
5.3.120.0060.03212.55
5.3.110.0090.01812.63
5.3.100.0070.02112.45
5.3.90.0090.01812.45
5.3.80.0050.02712.34
5.3.70.0040.02412.27
5.3.60.0040.02512.38
5.3.50.0080.02212.32
5.3.40.0070.01812.37
5.3.30.0050.02312.12
5.3.20.0040.02312.15
5.3.10.0080.01912.01
5.3.00.0100.02212.07
5.2.170.0050.02110.80
5.2.160.0050.02110.85
5.2.150.0030.02110.77
5.2.140.0100.01310.72
5.2.130.0050.01610.82
5.2.120.0060.01910.76
5.2.110.0050.01710.74
5.2.100.0050.01510.69
5.2.90.0060.01710.69
5.2.80.0060.01710.75
5.2.70.0040.02210.79
5.2.60.0040.02310.57
5.2.50.0050.01510.59
5.2.40.0050.02110.75
5.2.30.0070.01510.69
5.2.20.0060.02010.63
5.2.10.0050.01810.56
5.2.00.0070.01710.46
5.1.60.0070.01710.05
5.1.50.0060.01910.01
5.1.40.0070.01510.12
5.1.30.0050.01610.21
5.1.20.0040.01610.23
5.1.10.0080.01510.17
5.1.00.0070.01210.17
5.0.50.0060.0139.50
5.0.40.0050.0109.42
5.0.30.0040.0179.34
5.0.20.0050.0139.34
5.0.10.0050.0129.29
5.0.00.0050.0159.33
4.4.90.0040.0108.79
4.4.80.0050.0108.79
4.4.70.0040.0088.79
4.4.60.0020.0118.79
4.4.50.0010.0148.79
4.4.40.0020.0188.79
4.4.30.0020.0108.79
4.4.20.0020.0138.79
4.4.10.0040.0108.79
4.4.00.0020.0138.79
4.3.110.0050.0078.79
4.3.100.0040.0108.79
4.3.90.0030.0138.79
4.3.80.0010.0138.79
4.3.70.0030.0088.79
4.3.60.0050.0108.79
4.3.50.0010.0148.79
4.3.40.0000.0148.79
4.3.30.0030.0098.79
4.3.20.0040.0078.79
4.3.10.0040.0078.79
4.3.00.0020.0108.92

preferences:
46.53 ms | 400 KiB | 5 Q