3v4l.org

run code in 300+ PHP versions simultaneously
<?php include_once('classes/Connection.php'); $conn = Classes_DbConnection::getInstance(); $fileNumber = 0; // Read directory files into array $dirPath = '../media_data'; $dirFiles = array(); if ($handle = opendir($dirPath)) { while ($file = readdir($handle)) { $pathInfo = pathinfo($file); if (!is_dir("../media_data/" . $pathInfo['basename'])) { // Get media id, if there is one $idMedia = 0; $splitFilename = explode('_', $pathInfo['filename']); if($splitFilename[0] = '000' && is_numeric($splitFilename[1])) { $idMedia = $splitFilename[1]; } else if($splitFilename[0] = '000' && $splitFilename[0] = 'richtext' && is_numeric($splitFilename[2])) { $idMedia = $splitFilename[2]; } $pathInfo['filesize'] = filesize($dirPath . '/' . $file); $dirFiles[$idMedia][] = $pathInfo; } } } $clientsMedias = array(); foreach ($dirFiles as $idMedia => $files) { if ($idMedia != 0) { // @TODO: Code to avoid processing a files more than once $mediaClients = $conn->getByQuery(" SELECT mrc.id_media, mrc.id_client, mrc.status, mr.title, mr.media, mr.filename, mr.filenamePreview, mr.filenameImage FROM dw_media_resources_clients mrc inner join dw_media_resources mr on mrc.id_media = mr.id WHERE id_media = {$idMedia} "); if (!empty($mediaClients)) { foreach($mediaClients as $media) { $clientsMedias[$media['id_client']][$media['id_media']] = $media; $clientsMedias[$media['id_client']][$media['id_media']]['files'] = $files; } } } } ?> <pre> <?//= print_r($clientsMedias) ?> </pre> <? ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <meta http-equiv="Content-Language" content="en"/> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" /> <title>Izel Application Reports</title> <meta name="title" content="Izel Application Reports"/> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> <link rel="shortcut icon" href="images/favicon.png" /> <!-- css --> <link rel="stylesheet" href="css/normalize-custom.css" type="text/css" /> <link rel="stylesheet" href="css/styles.css" type="text/css" /> <!-- js --> <script src="js/jquery-1.8.2.min.js"></script> <script src="js/modernizr.js"></script> <script src="js/functions.js"></script> </head> <body> <div class="placer"> <h1>Storage Report</h1> <? foreach ($clientsMedias as $clientId => $clientMedia) { $clientTotalFilesize = 0; $clientTotalFilenumber = 0; ?> <!-- <h2><?= $clientId ?></h2> --> <? foreach ($clientMedia as $media) { $media_type; if($media['media'] == 2 /* Video */){ $media_type = '&#127916;'; } else if($media['media'] == 5 /* Article */ ){ $media_type = '&#59185;'; } else if($media['media'] == 4 /* Image */ ){ $media_type = '&#127748;'; } else if($media['media'] == 3 /* Audio */ ){ $media_type = '&#127925;'; } else if($media['media'] == 6 /* Rich text */ || $media['media'] == 7 /* Blog post */){ $media_type = '&#128240;'; } else if($media['media'] == 1 /* Other */ ){ $media_type = '&#128229;'; } ?> <!-- <table class="report"> <tr> <th class="cell_icon"><i><?=$media_type?></i></th> <th class="cell_title" colspan="3">ID #<?= $media['id_media'] ?> &middot; <?= $media['title'] ?></th> </tr> --> <? foreach ($media['files'] as $fileNumber => $mediaFile) { $filesize = $mediaFile['filesize'] / 1024 / 1024; $clientTotalFilesize += $mediaFile['filesize']; $clientTotalFilenumber += 1; ?> <!-- <tr> <td class="cell_icon icon_success"><i>&#10003;</i></td> <td class="cell_filename"><?= $mediaFile['basename'] ?></td> <td class="cell_filesize"><?= $filesize ?></td> <td>Status</td> </tr> --> <? } ?> <!-- </table> --> <? } ?> <table class="report"> <tr> <th class="cell_icon"><i>&#128203;</i></th> <th class="cell_title" colspan="3">CLIENT ID #<?= $clientId ?> &middot; Nombre de cliente</th> </tr> <tr> <td class="cell_icon"><i>&#57349;</i></td> <td class="cell_filename"><?= $clientTotalFilenumber ?> Archivos</td> <td class="cell_filesize" colspan="2"><?= $clientTotalFilesize / 1024 / 1024 ?> Mb.</td> </tr> </table> <? } ?> </div> </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.0170.00316.75
8.3.50.0110.00818.30
8.3.40.0060.00918.79
8.3.30.0160.00018.79
8.3.20.0040.00418.90
8.3.10.0060.00320.65
8.3.00.0060.00319.51
8.2.180.0090.00616.48
8.2.170.0000.01422.96
8.2.160.0120.00320.64
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00420.57
8.2.110.0090.00020.90
8.2.100.0090.00317.84
8.2.90.0060.00319.64
8.2.80.0070.00019.20
8.2.70.0040.00417.50
8.2.60.0060.00318.04
8.2.50.0050.00318.07
8.2.40.0050.00318.21
8.2.30.0030.00518.08
8.2.20.0090.00019.35
8.2.10.0080.00017.81
8.2.00.0050.00317.73
8.1.280.0030.01425.92
8.1.270.0030.00623.99
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0080.00022.47
8.1.230.0090.00321.13
8.1.220.0090.00017.89
8.1.210.0000.00919.05
8.1.200.0030.00717.35
8.1.190.0040.00417.66
8.1.180.0000.00818.10
8.1.170.0080.00018.95
8.1.160.0070.00018.77
8.1.150.0040.00418.69
8.1.140.0030.00617.41
8.1.130.0040.00417.77
8.1.120.0000.00717.38
8.1.110.0040.00417.45
8.1.100.0000.00717.52
8.1.90.0000.00717.46
8.1.80.0080.00017.44
8.1.70.0030.00317.36
8.1.60.0060.00317.67
8.1.50.0040.00417.46
8.1.40.0030.00517.57
8.1.30.0000.00817.76
8.1.20.0000.00817.76
8.1.10.0030.00617.62
8.1.00.0060.00317.58
8.0.300.0000.00720.18
8.0.290.0060.00317.00
8.0.280.0050.00318.49
8.0.270.0000.00717.07
8.0.260.0000.00816.97
8.0.250.0000.00717.13
8.0.240.0030.00317.17
8.0.230.0040.00417.02
8.0.220.0070.00017.02
8.0.210.0030.00316.97
8.0.200.0040.00417.20
8.0.190.0070.00017.12
8.0.180.0000.00717.02
8.0.170.0040.00416.94
8.0.160.0040.00416.98
8.0.150.0060.00617.09
8.0.140.0090.00217.05
8.0.130.0060.00013.60
8.0.120.0070.00314.33
8.0.110.0070.00314.43
8.0.100.0060.00414.37
8.0.90.0060.00414.44
8.0.80.0070.00714.37
8.0.70.0070.00214.35
8.0.60.0060.00414.31
8.0.50.0080.00214.38
8.0.30.0060.00614.36
8.0.20.0080.00614.81
8.0.10.0040.00514.31
8.0.00.0070.00614.80
7.4.330.0000.00513.18
7.4.320.0030.00316.57
7.4.300.0030.00316.66
7.4.290.0030.00316.73
7.4.280.0100.00016.62
7.4.270.0000.00716.57
7.4.260.0030.00313.32
7.4.250.0070.00214.03
7.4.240.0060.00514.10
7.4.230.0080.00414.16
7.4.220.0070.00614.08
7.4.210.0090.00414.05
7.4.200.0050.00614.00
7.4.190.0080.00314.11
7.4.180.0090.00413.39
7.4.160.0080.00514.13
7.4.150.0070.00614.15
7.4.140.0070.00614.06
7.4.130.0070.00613.99
7.4.120.0100.00314.04
7.4.110.0120.00414.04
7.4.100.0100.00314.18
7.4.90.0070.00614.03
7.4.80.0100.00515.04
7.4.70.0080.00514.53
7.4.60.0060.00714.52
7.4.50.0110.00214.38
7.4.40.0070.00814.39
7.4.30.0140.00514.54
7.4.20.0110.00714.08
7.4.10.0100.00614.18
7.4.00.0060.00914.27
7.3.330.0000.00613.28
7.3.320.0040.00413.19
7.3.310.0040.00413.98
7.3.300.0060.00413.92
7.3.290.0060.00914.77
7.3.280.0070.00514.40
7.3.270.0060.00713.85
7.3.260.0090.00413.92
7.3.250.0080.00614.51
7.3.240.0080.00513.94
7.3.230.0110.00313.86
7.3.220.0110.00213.00
7.3.210.0090.00413.95
7.3.200.0080.00514.41
7.3.190.0100.00414.33
7.3.180.0080.00614.46
7.3.170.0070.00814.36
7.3.160.0100.00714.38
7.3.150.0150.00613.72
7.3.140.0120.00613.84
7.3.130.0120.00714.13
7.3.120.0110.00614.11
7.3.110.0090.00814.03
7.3.100.0100.00714.16
7.3.90.0110.00714.27
7.3.80.0090.00514.11
7.3.70.0050.00814.08
7.3.60.0040.01014.11
7.3.50.0070.00514.03
7.3.40.0080.00714.22
7.3.30.0080.00514.14
7.3.20.0100.00315.46
7.3.10.0100.00415.41
7.3.00.0120.00415.54
7.2.340.0090.00413.16
7.2.330.0090.00513.98
7.2.320.0090.00513.97
7.2.310.0070.00814.53
7.2.300.0100.00714.58
7.2.290.0130.00614.57
7.2.280.0160.00514.03
7.2.270.0130.00514.05
7.2.260.0120.00714.25
7.2.250.0140.00514.22
7.2.240.0110.00714.24
7.2.230.0120.00614.30
7.2.220.0070.00814.15
7.2.210.0090.00614.25
7.2.200.0100.00614.23
7.2.190.0070.00814.22
7.2.180.0100.00614.27
7.2.170.0090.00714.33
7.2.160.0080.00714.14
7.2.150.0140.00315.68
7.2.140.0110.00715.61
7.2.130.0130.00315.64
7.2.120.0090.00715.74
7.2.110.0090.00815.77
7.2.100.0130.00515.71
7.2.90.0100.00615.74
7.2.80.0090.00615.67
7.2.70.0100.00715.73
7.2.60.0110.00515.83
7.2.50.0100.00715.75
7.2.40.0160.00315.76
7.2.30.0110.00815.76
7.2.20.0140.00615.83
7.2.10.0140.00515.70
7.2.00.0120.00716.45
7.1.330.0110.00614.70
7.1.320.0100.00414.66
7.1.310.0080.00514.59
7.1.300.0080.00714.71
7.1.290.0090.00514.65
7.1.280.0120.00614.65
7.1.270.0120.00414.69
7.1.260.0090.00814.63
7.1.250.0050.01114.66
7.1.240.0120.00514.66
7.1.230.0130.00514.61
7.1.220.0100.00614.75
7.1.210.0130.00414.64
7.1.200.0090.00714.86
7.1.190.0070.00814.70
7.1.180.0090.00914.63
7.1.170.0080.01014.66
7.1.160.0100.01014.62
7.1.150.0130.00614.68
7.1.140.0120.00514.67
7.1.130.0180.00414.65
7.1.120.0090.00614.62
7.1.110.0100.00814.70
7.1.100.0070.00915.24
7.1.90.0130.00514.60
7.1.80.0130.00614.64
7.1.70.0080.00615.04
7.1.60.0150.00415.47
7.1.50.0110.00715.05
7.1.40.0150.00714.73
7.1.30.0100.00514.66
7.1.20.0120.00714.63
7.1.10.0070.00914.62
7.1.00.0100.01615.90
7.0.330.0100.00514.49
7.0.320.0090.00714.48
7.0.310.0090.00514.33
7.0.300.0100.00714.46
7.0.290.0120.00414.40
7.0.280.0130.00614.48
7.0.270.0100.00814.39
7.0.260.0110.00514.45
7.0.250.0090.00714.54
7.0.240.0100.00614.50
7.0.230.0120.00614.46
7.0.220.0080.00814.54
7.0.210.0110.00414.47
7.0.200.0100.00614.57
7.0.190.0090.00814.49
7.0.180.0110.00714.55
7.0.170.0120.00414.48
7.0.160.0090.00614.52
7.0.150.0110.00514.42
7.0.140.0100.01615.71
7.0.130.0130.00414.44
7.0.120.0080.01715.74
7.0.110.0100.02015.35
7.0.100.0120.01615.36
7.0.90.0130.01815.30
7.0.80.0110.01415.35
7.0.70.0070.02015.38
7.0.60.0110.01815.41
7.0.50.0100.01815.33
7.0.40.0130.01714.98
7.0.30.0120.01514.99
7.0.20.0110.01614.98
7.0.10.0100.01914.95
7.0.00.0140.01514.97
5.6.400.0120.00413.54
5.6.390.0080.01113.55
5.6.380.0090.00613.43
5.6.370.0060.00813.61
5.6.360.0080.00813.53
5.6.350.0100.00513.52
5.6.340.0080.00713.51
5.6.330.0070.00913.57
5.6.320.0120.00413.54
5.6.310.0120.00413.54
5.6.300.0100.00813.47
5.6.290.0130.00313.51
5.6.280.0110.01714.82
5.6.270.0090.00813.58
5.6.260.0090.02014.66
5.6.250.0110.01614.71
5.6.240.0100.01814.66
5.6.230.0100.02114.61
5.6.220.0100.01614.72
5.6.210.0140.01714.64
5.6.200.0120.01614.73
5.6.190.0070.02214.75
5.6.180.0090.01814.79
5.6.170.0100.01814.72
5.6.160.0110.01814.77
5.6.150.0100.01314.72
5.6.140.0120.01714.74
5.6.130.0070.02014.70
5.6.120.0110.01714.70
5.6.110.0110.01714.57
5.6.100.0080.02114.75
5.6.90.0110.01914.69
5.6.80.0090.01814.52
5.6.70.0120.01614.55
5.6.60.0120.01614.53
5.6.50.0110.01714.60
5.6.40.0100.01914.60
5.6.30.0090.01914.60
5.6.20.0100.01514.54
5.6.10.0080.01914.53
5.6.00.0100.01714.49
5.5.380.0090.01814.60
5.5.370.0100.01614.68
5.5.360.0090.01314.52
5.5.350.0090.01814.50
5.5.340.0110.01814.55
5.5.330.0110.01714.58
5.5.320.0090.01814.54
5.5.310.0130.01714.62
5.5.300.0100.01514.63
5.5.290.0100.01514.61
5.5.280.0110.01614.59
5.5.270.0110.01314.60
5.5.260.0070.02114.64
5.5.250.0140.01814.60
5.5.240.0080.01814.54
5.5.230.0080.02014.54
5.5.220.0100.01614.52
5.5.210.0100.01814.54
5.5.200.0090.02014.44
5.5.190.0090.01914.44
5.5.180.0100.01314.44
5.5.170.0090.00913.27
5.5.160.0110.01614.54
5.5.150.0100.01814.46
5.5.140.0100.01714.45
5.5.130.0130.01314.43
5.5.120.0110.01714.40
5.5.110.0120.01614.38
5.5.100.0090.01814.43
5.5.90.0110.01514.54
5.5.80.0080.01614.43
5.5.70.0090.01714.51
5.5.60.0090.01714.55
5.5.50.0100.01614.49
5.5.40.0070.01814.48
5.5.30.0090.01814.42
5.5.20.0100.01314.40
5.5.10.0130.01714.41
5.5.00.0120.01814.43
5.4.450.0080.01313.38
5.4.440.0090.01713.38
5.4.430.0080.01913.33
5.4.420.0100.01813.35
5.4.410.0090.01613.32
5.4.400.0080.01613.21
5.4.390.0070.01913.21
5.4.380.0100.01413.17
5.4.370.0060.02113.26
5.4.360.0090.01513.23
5.4.350.0100.01313.25
5.4.340.0110.01613.25
5.4.330.0070.00712.12
5.4.320.0080.01913.28
5.4.310.0050.01813.27
5.4.300.0120.01113.34
5.4.290.0080.01713.30
5.4.280.0080.01713.24
5.4.270.0080.01713.26
5.4.260.0070.01213.24
5.4.250.0100.01513.24
5.4.240.0110.01213.29
5.4.230.0110.01513.17
5.4.220.0100.01513.17
5.4.210.0100.01613.10
5.4.200.0090.01713.13
5.4.190.0070.01713.20
5.4.180.0110.01313.06
5.4.170.0100.01413.20
5.4.160.0080.01813.19
5.4.150.0110.01613.13
5.4.140.0100.01612.87
5.4.130.0090.01412.81
5.4.120.0080.01012.82
5.4.110.0050.02012.83
5.4.100.0090.01612.82
5.4.90.0110.00912.90
5.4.80.0100.01612.83
5.4.70.0100.01312.98
5.4.60.0090.01712.83
5.4.50.0100.01412.87
5.4.40.0090.01612.78
5.4.30.0080.01612.79
5.4.20.0080.01712.85
5.4.10.0090.01512.85
5.4.00.0090.01512.67
5.3.290.0090.01812.87
5.3.280.0090.01312.77
5.3.270.0080.01412.92
5.3.260.0100.01712.87
5.3.250.0090.01712.84
5.3.240.0120.01312.81
5.3.230.0070.01912.76
5.3.220.0080.01712.89
5.3.210.0090.01312.81
5.3.200.0080.01812.85
5.3.190.0080.01812.78
5.3.180.0090.01712.98
5.3.170.0100.01812.91
5.3.160.0090.01712.88
5.3.150.0070.01712.95
5.3.140.0070.01912.84
5.3.130.0080.01812.79
5.3.120.0080.01712.86
5.3.110.0090.01812.78
5.3.100.0100.01412.83
5.3.90.0070.01812.82
5.3.80.0080.01712.77
5.3.70.0080.01512.76
5.3.60.0110.01412.76
5.3.50.0080.01712.66
5.3.40.0080.01212.72
5.3.30.0050.01912.69
5.3.20.0080.01712.68
5.3.10.0080.01612.55
5.3.00.0070.01312.41
5.2.170.0070.01611.82
5.2.160.0040.01912.00
5.2.150.0060.01411.96
5.2.140.0100.01311.86
5.2.130.0070.01211.87
5.2.120.0060.01811.86
5.2.110.0070.01511.84
5.2.100.0070.01711.86
5.2.90.0060.01611.82
5.2.80.0080.01511.82
5.2.70.0050.01911.86
5.2.60.0090.01211.79
5.2.50.0100.01411.84
5.2.40.0040.01811.86
5.2.30.0080.01111.85
5.2.20.0070.01611.69
5.2.10.0060.01611.76
5.2.00.0090.01311.66
5.1.60.0050.01511.32
5.1.50.0070.01311.30
5.1.40.0090.01111.26
5.1.30.0050.01511.38
5.1.20.0060.01511.31
5.1.10.0060.01411.38
5.1.00.0040.01611.34
5.0.50.0050.00911.06
5.0.40.0060.00711.06
5.0.30.0050.01611.06
5.0.20.0050.01111.06
5.0.10.0050.01111.06
5.0.00.0040.01811.06
4.4.90.0030.00911.06
4.4.80.0030.00811.06
4.4.70.0040.00811.06
4.4.60.0040.00511.06
4.4.50.0030.00511.06
4.4.40.0030.01311.06
4.4.30.0030.00911.06
4.4.20.0030.00911.06
4.4.10.0050.00711.06
4.4.00.0030.01311.06
4.3.110.0040.00811.06
4.3.100.0030.00911.06
4.3.90.0030.00811.06
4.3.80.0040.01211.06
4.3.70.0020.01011.06
4.3.60.0010.01011.06
4.3.50.0040.00711.06
4.3.40.0020.01111.06
4.3.30.0030.00811.06
4.3.20.0010.01111.06
4.3.10.0020.00911.06
4.3.00.0010.01011.06

preferences:
59.21 ms | 401 KiB | 5 Q