3v4l.org

run code in 300+ PHP versions simultaneously
<!doctype html> <head> <title>Creating an image gallery</title> <style type="text/css"> ul { list-style-type: none; } li { float: left; padding:10px; margin:10px; font:bold 10px Verdana sans-serief; } img { display:block; border:1px solid #333300; margin-border:5px; } </style> </head> <body> <h2>Creating an image gallery</h2> <ul> <?php $photosDir='./picture'; $photosExt=array('gif', 'jpg','jpeg','tif', 'tiff', 'bmp','png'); $photosList=array(); if(file_exists($photosDir)) { $dp=opendir($photosDir) or die ('ERROR: Cannot open Directory'); while($file=readdir($dp)) { if($file!='.' && $file!='..') { $fileData=pathinfo($file); if(in_array($fileData['extension'],$photosExt)) { $photosList[]="$photosDir/$file"; } } } closedir($dp); } else { die('ERROR: Directory doesnot exists.'); } if(count($photosList)>0) { for($x=0; $x<count($photosList); $x++) ?> <li> <img height="150" width="200" src="<?php echo $photosList[$x];?>"/> <?php echo basename($photosList[$x]);?><br/> <?php echo round(filesize($photosList[$x])/1024) . 'KB' ;?> </li> <?php } else { die('ERROR: No image found in Directory.'); } ?> </ul> </body> </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.0070.01418.56
8.3.50.0170.00521.92
8.3.40.0060.00918.79
8.3.30.0110.00418.95
8.3.20.0000.00720.33
8.3.10.0050.00221.92
8.3.00.0050.00322.57
8.2.180.0070.00718.42
8.2.170.0110.00419.04
8.2.160.0090.00622.96
8.2.150.0000.00825.66
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0030.00617.63
8.2.110.0100.00022.08
8.2.100.0080.00418.04
8.2.90.0000.00919.05
8.2.80.0090.00017.97
8.2.70.0060.00317.48
8.2.60.0050.00318.04
8.2.50.0030.00618.07
8.2.40.0050.00319.21
8.2.30.0040.00418.09
8.2.20.0040.00417.73
8.2.10.0040.00418.04
8.2.00.0080.00018.16
8.1.280.0140.00725.92
8.1.270.0100.00720.38
8.1.260.0090.00026.35
8.1.250.0030.00528.09
8.1.240.0100.00022.16
8.1.230.0120.00019.16
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0000.00817.36
8.1.180.0040.00418.10
8.1.170.0030.00618.51
8.1.160.0000.00821.99
8.1.150.0000.00718.78
8.1.140.0020.00517.38
8.1.130.0000.00717.58
8.1.120.0040.00417.43
8.1.110.0050.00317.45
8.1.100.0000.00717.49
8.1.90.0000.00717.34
8.1.80.0080.00017.31
8.1.70.0000.01017.43
8.1.60.0070.00017.56
8.1.50.0040.00417.58
8.1.40.0030.00617.52
8.1.30.0040.00417.55
8.1.20.0040.00417.66
8.1.10.0030.00517.59
8.1.00.0030.00617.38
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0000.00818.47
8.0.270.0040.00417.30
8.0.260.0060.00017.29
8.0.250.0030.00317.04
8.0.240.0030.00317.04
8.0.230.0000.00717.00
8.0.220.0000.00716.80
8.0.210.0000.00716.79
8.0.200.0000.00616.92
8.0.190.0000.00816.99
8.0.180.0050.00316.98
8.0.170.0040.00516.95
8.0.160.0000.00716.83
8.0.150.0000.00716.93
8.0.140.0040.00416.85
8.0.130.0030.00313.30
8.0.120.0060.00414.26
8.0.110.0050.00514.22
8.0.100.0070.00314.20
8.0.90.0050.00514.29
8.0.80.0050.00814.30
8.0.70.0090.00214.31
8.0.60.0070.00314.25
8.0.50.0080.00214.22
8.0.30.0070.00614.80
8.0.20.0060.00814.99
8.0.10.0070.00314.31
8.0.00.0070.00615.09
7.4.330.0030.00315.04
7.4.320.0030.00316.56
7.4.300.0000.00616.57
7.4.290.0070.00016.44
7.4.280.0000.00816.54
7.4.270.0070.00016.49
7.4.260.0000.00716.55
7.4.250.0090.00414.01
7.4.240.0070.00414.58
7.4.230.0080.00414.10
7.4.220.0070.00814.05
7.4.210.0060.00614.06
7.4.200.0060.00414.03
7.4.190.0090.00413.23
7.4.180.0070.00613.26
7.4.160.0080.00514.14
7.4.150.0090.00414.27
7.4.140.0060.00815.05
7.4.130.0110.00414.47
7.4.120.0110.00514.46
7.4.110.0100.00513.98
7.4.100.0070.00714.01
7.4.90.0080.00614.03
7.4.80.0070.00614.71
7.4.70.0060.00713.99
7.4.60.0050.00714.01
7.4.50.0070.00413.95
7.4.40.0100.00413.96
7.4.30.0070.00714.02
7.4.20.0070.00413.11
7.4.10.0070.00413.14
7.4.00.0060.00613.83
7.3.330.0020.00212.95
7.3.320.0080.00313.14
7.3.310.0070.00413.82
7.3.300.0070.00413.84
7.3.290.0090.00414.64
7.3.280.0100.00514.67
7.3.270.0080.00614.09
7.3.260.0090.00513.89
7.3.250.0090.00614.69
7.3.240.0110.00213.87
7.3.230.0090.00513.90
7.3.220.0080.00413.01
7.3.210.0060.00713.85
7.3.200.0100.00514.58
7.3.190.0050.00713.87
7.3.180.0070.00713.75
7.3.170.0060.00513.76
7.3.160.0060.00713.83
7.3.150.0060.00612.95
7.3.140.0080.00312.94
7.3.130.0060.00512.96
7.3.120.0060.00413.29
7.3.110.0060.00513.37
7.3.100.0060.00413.33
7.3.90.0060.00613.55
7.3.80.0070.00313.42
7.3.70.0060.00413.35
7.3.60.0070.00413.43
7.3.50.0070.00413.54
7.3.40.0030.00613.51
7.3.30.0060.00313.55
7.3.20.0080.00215.26
7.3.10.0030.00615.27
7.3.00.0070.00215.16
7.2.340.0100.00313.03
7.2.330.0100.00514.03
7.2.320.0130.00214.01
7.2.310.0100.00513.98
7.2.300.0080.00713.90
7.2.290.0100.00613.88
7.2.280.0080.00413.12
7.2.270.0060.00613.16
7.2.260.0090.00413.13
7.2.250.0080.00613.57
7.2.240.0070.00613.56
7.2.230.0100.00413.52
7.2.220.0090.00413.49
7.2.210.0090.00413.56
7.2.200.0110.00313.60
7.2.190.0060.00613.56
7.2.180.0090.00313.67
7.2.170.0040.00913.56
7.2.160.0070.00613.27
7.2.150.0070.00614.99
7.2.140.0120.00115.00
7.2.130.0120.00215.09
7.2.120.0110.00115.14
7.2.110.0100.00315.10
7.2.100.0080.00515.08
7.2.90.0090.00515.07
7.2.80.0090.00415.02
7.2.70.0100.00415.07
7.2.60.0110.00115.04
7.2.50.0130.00115.03
7.2.40.0080.00515.11
7.2.30.0080.00515.14
7.2.20.0100.00415.11
7.2.10.0100.00315.15
7.2.00.0090.00416.25
7.1.330.0060.00714.50
7.1.320.0080.00414.51
7.1.310.0080.00314.58
7.1.300.0080.00514.52
7.1.290.0050.00714.50
7.1.280.0080.00414.50
7.1.270.0070.00614.45
7.1.260.0060.00614.45
7.1.250.0060.00614.10
7.1.240.0110.00114.10
7.1.230.0070.00514.23
7.1.220.0060.00614.22
7.1.210.0110.00114.14
7.1.200.0120.00014.10
7.1.190.0090.00314.15
7.1.180.0060.00614.16
7.1.170.0090.00314.12
7.1.160.0110.00114.11
7.1.150.0120.00013.97
7.1.140.0070.00514.16
7.1.130.0100.00214.11
7.1.120.0080.00414.16
7.1.110.0070.00514.07
7.1.100.0080.00415.10
7.1.90.0090.00313.96
7.1.80.0110.00114.09
7.1.70.0080.00514.64
7.1.60.0090.00615.49
7.1.50.0080.00714.76
7.1.40.0110.00214.15
7.1.30.0080.00414.09
7.1.20.0110.00114.03
7.1.10.0080.00414.10
7.1.00.0090.01916.04
7.0.330.0090.00313.98
7.0.320.0070.00413.95
7.0.310.0090.00314.00
7.0.300.0080.00413.97
7.0.290.0080.00414.00
7.0.280.0070.00413.88
7.0.270.0080.00313.92
7.0.260.0070.00414.02
7.0.250.0100.00214.08
7.0.240.0090.00314.11
7.0.230.0090.00214.08
7.0.220.0090.00314.01
7.0.210.0090.00214.06
7.0.200.0070.00414.74
7.0.190.0080.00314.00
7.0.180.0060.00614.04
7.0.170.0090.00214.09
7.0.160.0050.00714.01
7.0.150.0080.00413.92
7.0.140.0090.00313.92
7.0.130.0090.00314.02
7.0.120.0110.00114.06
7.0.110.0100.00313.92
7.0.100.0110.00113.98
7.0.90.0110.00213.87
7.0.80.0110.00113.87
7.0.70.0100.00313.94
7.0.60.0090.02315.46
7.0.50.0150.01614.83
7.0.40.0050.01515.50
7.0.30.0200.01815.51
7.0.20.0150.02215.47
7.0.10.0170.01415.50
7.0.00.0080.02215.45
5.6.400.0070.00512.52
5.6.390.0080.00412.50
5.6.380.0050.00712.42
5.6.370.0060.00512.56
5.6.360.0070.00612.40
5.6.350.0080.00312.41
5.6.340.0090.00312.50
5.6.330.0050.00612.52
5.6.320.0060.00612.62
5.6.310.0090.00312.64
5.6.300.0090.00312.35
5.6.290.0080.00412.55
5.6.280.0070.01414.66
5.6.270.0100.00212.45
5.6.260.0070.00412.52
5.6.250.0090.00312.48
5.6.240.0090.00212.54
5.6.230.0060.00512.67
5.6.220.0090.00312.65
5.6.210.0080.01814.55
5.6.200.0060.01414.06
5.6.190.0130.01914.61
5.6.180.1090.01314.61
5.6.170.0140.02114.62
5.6.160.0070.02514.66
5.6.150.0090.02014.01
5.6.140.0060.01814.07
5.6.130.0050.02514.02
5.6.120.0080.01714.76
5.6.110.0100.02114.72
5.6.100.0090.01514.72
5.6.90.0080.02214.68
5.6.80.0080.01614.44
5.6.70.0160.01814.50
5.6.60.0090.00312.52
5.6.50.0100.00212.51
5.6.40.0090.00212.52
5.6.30.0100.00112.51
5.6.20.0080.00312.48
5.6.10.0090.00212.50
5.6.00.0080.00312.63
5.5.380.0100.00212.79
5.5.370.0090.00312.57
5.5.360.0100.00212.50
5.5.350.0100.01614.57
5.5.340.0110.01913.85
5.5.330.0070.01814.54
5.5.320.0220.01714.43
5.5.310.0100.01514.43
5.5.300.0090.01413.79
5.5.290.0070.02213.90
5.5.280.0080.01214.60
5.5.270.0070.02414.54
5.5.260.0100.02314.57
5.5.250.0070.01914.63
5.5.240.0090.01414.43
5.5.230.0100.00112.61
5.5.220.0100.00112.50
5.5.210.0090.00212.59
5.5.200.0100.00112.56
5.5.190.0080.00312.39
5.5.180.0100.00112.42
5.5.170.0090.00212.43
5.5.160.0100.00112.36
5.5.150.0050.00612.31
5.5.140.0090.00312.29
5.5.130.0080.00412.33
5.5.120.0080.00412.37
5.5.110.0090.00212.39
5.5.100.0110.00112.55
5.5.90.0080.00412.54
5.5.80.0050.00612.48
5.5.70.0080.00312.56
5.5.60.0060.00512.45
5.5.50.0090.00112.45
5.5.40.0060.00512.49
5.5.30.0050.00612.52
5.5.20.0070.00412.47
5.5.10.0070.00412.35
5.5.00.0090.00312.62
5.4.450.0090.01614.28
5.4.440.0100.01514.25
5.4.430.0100.01614.23
5.4.420.0090.01714.19
5.4.410.0110.01514.16
5.4.400.0070.01813.99
5.4.390.0090.01614.09
5.4.380.0080.01714.17
5.4.370.0130.01614.05
5.4.360.0080.01714.07
5.4.350.0090.01914.07
5.4.340.0100.01514.16
5.4.330.0080.00412.35
5.4.320.0100.01614.13
5.4.310.0120.01314.02
5.4.300.0070.01814.21
5.4.290.0060.01914.18
5.4.280.0080.01814.09
5.4.270.0090.01614.15
5.4.260.0110.01414.19
5.4.250.0080.01714.05
5.4.240.0150.01013.98
5.4.230.0100.01513.95
5.4.220.0100.01613.96
5.4.210.0120.01613.92
5.4.200.0110.01413.38
5.4.190.0130.01213.92
5.4.180.0120.01413.99
5.4.170.0110.01613.93
5.4.160.0100.01514.08
5.4.150.0100.01413.90
5.4.140.0070.01613.43
5.4.130.0070.01513.43
5.4.120.0070.01513.49
5.4.110.0050.01813.52
5.4.100.0090.01513.44
5.4.90.0080.01513.56
5.4.80.0100.01313.45
5.4.70.0090.01413.38
5.4.60.0060.01713.54
5.4.50.0110.01213.46
5.4.40.0080.01613.58
5.4.30.0080.01513.48
5.4.20.0080.01513.52
5.4.10.0090.01413.43
5.4.00.0130.01113.19
5.3.290.0110.01513.50
5.3.280.0050.01913.21
5.3.270.0070.01913.37
5.3.260.0100.01513.37
5.3.250.0080.01713.42
5.3.240.0120.01313.29
5.3.230.0100.01513.29
5.3.220.0110.01413.26
5.3.210.0090.01613.19
5.3.200.0080.01713.25
5.3.190.0070.01813.17
5.3.180.0110.01313.29
5.3.170.0090.01513.41
5.3.160.0090.01613.39
5.3.150.0100.01613.25
5.3.140.0100.01413.29
5.3.130.0090.01713.37
5.3.120.0080.01713.35
5.3.110.0100.01713.27
5.3.100.0100.01413.08
5.3.90.0060.01913.24
5.3.80.0090.01512.99
5.3.70.0050.01812.90
5.3.60.0040.02013.09
5.3.50.0090.01613.00
5.3.40.0070.01812.95
5.3.30.0130.01113.08
5.3.20.0090.01412.92
5.3.10.0090.01412.82
5.3.00.0090.01512.81
5.2.170.0080.01111.71
5.2.160.0080.01211.72
5.2.150.0090.01211.71
5.2.140.0070.01311.57
5.2.130.0080.01211.67
5.2.120.0070.01311.75
5.2.110.0130.01011.71
5.2.100.0070.01211.72
5.2.90.0070.01211.71
5.2.80.0070.01211.65
5.2.70.0030.01611.63
5.2.60.0060.01411.62
5.2.50.0080.01111.61
5.2.40.0080.01111.69
5.2.30.0070.01311.56
5.2.20.0070.01311.50
5.2.10.0060.01311.44
5.2.00.0050.01511.30
5.1.60.0050.01110.69
5.1.50.0070.01010.79
5.1.40.0060.01010.76
5.1.30.0060.01310.84
5.1.20.0080.01010.78
5.1.10.0090.01010.75
5.1.00.0050.01210.73
5.0.50.0020.0119.94
5.0.40.0070.0069.93
5.0.30.0060.0129.91
5.0.20.0030.0119.92
5.0.10.0050.0099.87
5.0.00.0070.0109.89
4.4.90.0030.0079.32
4.4.80.0030.0079.29
4.4.70.0010.0089.30
4.4.60.0030.0069.31
4.4.50.0040.0059.30
4.4.40.0030.0099.32
4.4.30.0020.0089.31
4.4.20.0030.0079.33
4.4.10.0040.0059.30
4.4.00.0030.0099.29
4.3.110.0020.0089.29
4.3.100.0030.0069.27
4.3.90.0010.0089.26
4.3.80.0030.0099.28
4.3.70.0050.0039.27
4.3.60.0030.0069.29
4.3.50.0040.0069.30
4.3.40.0010.0119.28
4.3.30.0020.0079.00
4.3.20.0030.0068.98
4.3.10.0020.0098.95
4.3.00.0060.0059.63

preferences:
69.18 ms | 401 KiB | 5 Q