3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = get_the_content(); $description = array(); $j=0; if (preg_match_all('/<div id="description" class="description">([^<]*)<\/div>/', $content, $match)) { for( $i = 0; $i < count($match[0]); $i = $i+1 ) { $description[] = $match[0][$i]; } } $attachments =& get_children($args); $arrayMatches = array(); if ($attachments) { foreach(array_chunk($attachments, 2) as $img) { echo '<div class="two_cols">'; foreach($img as $attachment) { foreach($attachment as $attachment_key => $attachment_value) { $imageID = $attachment->ID; $imageTitle = $attachment->post_title; $imagearray = wp_get_attachment_image_src($attachment_value, $size, false); $imageAlt = get_post_meta($imageID, '_wp_attachment_image_alt', true); $imageURI = $imagearray[0]; // 0 is the URI $imageWidth = $imagearray[1]; // 1 is the width $imageHeight = $imagearray[2]; // 2 is the height ?> <div class="col_1_2"> <div id="attachment_<?php echo $imageID; ?>" class="wp-caption alignnone" style="width: 356px;"> <a rel="lightbox-0" href="<?php echo $imageURI; ?>"><img class="wp-image-<?php echo $imageID; ?> size-full" title="<?php echo $imageTitle; ?>" src="<?php echo $imageURI; ?>" alt="<?php echo $imageAlt; ?>" width="456" height="304" /></a> <p class="wp-caption-text"><?php echo $imageTitle; ?></p> <div class="full-description"><?php echo $match[0][$j];?></div> <?php //Array already declare $arrayMatches[] = $match[0][$j]; ?> </div> </div> <?php break; } $j++; } // I'm into a foreach (line 6) $result = array(); array_walk_recursive($arrayMatches, function($v, $k)use(&$result){ $result[] = $v; }); $$result = array_chunk($$result, 2); foreach($$result as $v) { echo "<div>" . implode(" ", $v) . "</div>"; } echo '</div>'; } }

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.0110.00416.63
8.3.50.0130.00722.05
8.3.40.0090.00618.84
8.3.30.0090.00619.14
8.3.20.0040.00420.30
8.3.10.0040.00421.75
8.3.00.0080.00019.25
8.2.180.0100.01018.41
8.2.170.0110.00422.96
8.2.160.0120.00320.89
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00319.23
8.2.110.0030.00719.16
8.2.100.0040.00817.91
8.2.90.0000.00917.76
8.2.80.0040.00417.97
8.2.70.0070.00317.80
8.2.60.0000.00918.07
8.2.50.0060.00318.10
8.2.40.0030.00619.31
8.2.30.0030.00519.09
8.2.20.0080.00017.70
8.2.10.0050.00317.91
8.2.00.0080.00017.69
8.1.280.0070.01425.92
8.1.270.0030.00618.71
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0140.00319.45
8.1.230.0090.00322.75
8.1.220.0050.00317.74
8.1.210.0000.01118.92
8.1.200.0070.00317.23
8.1.190.0030.00517.22
8.1.180.0030.00618.10
8.1.170.0050.00318.53
8.1.160.0000.00718.80
8.1.150.0000.00718.66
8.1.140.0040.00417.31
8.1.130.0000.00717.73
8.1.120.0040.00417.32
8.1.110.0050.00317.31
8.1.100.0050.00317.39
8.1.90.0000.00817.27
8.1.80.0030.00417.35
8.1.70.0080.00017.29
8.1.60.0070.00317.50
8.1.50.0040.00417.55
8.1.40.0090.00317.46
8.1.30.0080.00017.58
8.1.20.0030.00517.58
8.1.10.0030.00617.57
8.1.00.0000.00917.36
8.0.300.0030.00619.67
8.0.290.0070.00016.75
8.0.280.0040.00418.33
8.0.270.0000.00717.29
8.0.260.0000.00617.23
8.0.250.0050.00216.93
8.0.240.0070.00016.98
8.0.230.0000.00716.96
8.0.220.0030.00516.94
8.0.210.0080.00017.00
8.0.200.0000.00716.95
8.0.190.0060.00316.98
8.0.180.0000.00716.96
8.0.170.0000.00816.98
8.0.160.0070.00016.96
8.0.150.0000.00716.84
8.0.140.0040.00416.95
8.0.130.0050.00213.41
8.0.120.0040.00416.88
8.0.110.0040.00416.93
8.0.100.0000.00816.98
8.0.90.0040.00416.79
8.0.80.0100.00716.96
8.0.70.0000.00716.91
8.0.60.0080.00016.93
8.0.50.0040.00416.91
8.0.30.0140.00817.02
8.0.20.0110.01117.40
8.0.10.0000.00817.05
8.0.00.0100.01016.71
7.4.330.0000.00615.03
7.4.320.0080.00016.46
7.4.300.0060.00016.57
7.4.290.0030.00616.52
7.4.280.0060.00316.56
7.4.270.0000.00716.33
7.4.260.0040.00416.38
7.4.250.0040.00416.39
7.4.240.0040.00416.50
7.4.230.0040.00416.47
7.4.220.0090.00916.67
7.4.210.0080.00616.54
7.4.200.0040.00416.37
7.4.160.0060.00916.45
7.4.150.0110.00717.40
7.4.140.0170.00617.86
7.4.130.0230.01516.51
7.4.120.0130.00716.46
7.4.110.0060.01216.55
7.4.100.0140.00416.43
7.4.90.0090.00916.71
7.4.80.0110.00719.39
7.4.70.0100.01016.32
7.4.60.0110.00416.56
7.4.50.0040.00016.64
7.4.40.0160.00616.54
7.4.30.0100.01316.55
7.4.00.0040.01214.75
7.3.330.0000.00513.16
7.3.320.0070.00713.13
7.3.310.0000.00716.37
7.3.300.0070.00016.31
7.3.290.0000.00716.31
7.3.280.0110.00616.31
7.3.270.0180.00617.40
7.3.260.0160.00616.20
7.3.250.0150.00516.38
7.3.240.0100.00716.62
7.3.230.0120.00616.39
7.3.210.0120.00616.41
7.3.200.0120.00419.39
7.3.190.0090.00716.31
7.3.180.0090.00616.54
7.3.170.0090.00916.28
7.3.160.0160.00316.60
7.3.10.0070.00916.39
7.3.00.0050.00716.53
7.2.330.0100.00716.59
7.2.320.0150.00316.69
7.2.310.0030.01316.68
7.2.300.0100.01016.57
7.2.290.0100.01416.45
7.2.130.0040.01016.50
7.2.120.0030.00816.70
7.2.110.0050.00916.59
7.2.100.0070.00916.64
7.2.90.0070.00916.61
7.2.80.0080.00616.55
7.2.70.0060.00716.64
7.2.60.0080.00616.74
7.2.50.0040.00916.68
7.2.40.0020.01116.50
7.2.30.0020.01016.63
7.2.20.0050.00816.51
7.2.10.0050.00716.61
7.2.00.0060.00817.45
7.1.250.0070.00415.55
7.1.200.0070.00715.33
7.1.100.0030.01517.88
7.1.70.0000.00817.00
7.1.60.0120.01219.50
7.1.50.0090.01616.96
7.1.00.0030.07722.42
7.0.200.0030.00714.62
7.0.140.0000.07722.04
7.0.60.0100.05721.68
7.0.50.0030.04717.92
7.0.40.0100.04720.09
7.0.30.0230.05720.11
7.0.20.0200.04320.06
7.0.10.0030.07720.07
7.0.00.0130.08720.24
5.6.280.0000.07321.10
5.6.210.0130.04320.75
5.6.200.0170.06318.29
5.6.190.0130.07720.47
5.6.180.3500.04320.50
5.6.170.0230.04320.62
5.6.160.0130.08020.47
5.6.150.0030.07018.17
5.6.140.0070.08318.27
5.6.130.0130.05318.21
5.6.120.0100.05721.00
5.6.110.0030.08021.03
5.6.100.0100.08021.02
5.6.90.0130.07021.14
5.6.80.0030.07320.30
5.5.350.0030.08720.36
5.5.340.0130.07017.94
5.5.330.0000.04320.27
5.5.320.0270.04720.33
5.5.310.0330.07020.26
5.5.300.0070.07017.98
5.5.290.0130.04717.95
5.5.280.0030.05020.75
5.5.270.0070.03720.81
5.5.260.0070.08020.86
5.5.250.0100.03720.79
5.5.240.0070.08320.09
5.4.450.0770.07319.65
5.4.440.0100.06019.47
5.4.430.0100.05719.61
5.4.420.0130.06019.16
5.4.410.0270.05018.95
5.4.400.1500.06718.77
5.4.390.1130.07018.51
5.4.380.0930.08318.50
5.4.370.0930.06318.63
5.4.360.1230.05018.82
5.4.350.1000.07018.72
5.4.340.1030.07018.79
5.4.320.1170.05318.72
5.4.310.1000.07018.80
5.4.300.1200.07018.70
5.4.290.1170.05718.78
5.4.280.1230.06018.74
5.4.270.1270.05018.60
5.4.260.0830.08018.47
5.4.250.1230.06318.70
5.4.240.1100.06018.74
5.4.230.0800.06318.69
5.4.220.1070.08018.48
5.4.210.0900.06018.77
5.4.200.1070.05716.78
5.4.190.0930.06018.73
5.4.180.1200.06318.57
5.4.170.0900.06718.45
5.4.160.0970.07718.60
5.4.150.0800.07018.69
5.4.140.0800.07716.31
5.4.130.1270.06716.47
5.4.120.0500.07316.30
5.4.110.0370.06716.31
5.4.100.0900.07016.30
5.4.90.1170.07016.20
5.4.80.0830.06716.42
5.4.70.0400.05716.42
5.4.60.0530.06016.27
5.4.50.1000.06716.16
5.4.40.0970.05716.16
5.4.30.1000.06316.17
5.4.20.0900.07016.39
5.4.10.0970.06716.27
5.4.00.0930.06715.76
5.3.290.1070.06014.78
5.3.280.0900.05714.83
5.3.270.0900.05714.76
5.3.260.1070.05314.65
5.3.250.0870.08314.66
5.3.240.0970.07714.64
5.3.230.0930.05714.64
5.3.220.1170.07314.79
5.3.210.1270.06014.57
5.3.200.0630.07014.63
5.3.190.1070.07314.72
5.3.180.0930.06714.76
5.3.170.1130.05714.64
5.3.160.1230.05714.77
5.3.150.1070.06314.56
5.3.140.0930.07014.60
5.3.130.1100.06714.61
5.3.120.0770.06714.67
5.3.110.0770.06714.69
5.3.100.0970.05714.05
5.3.90.0800.08314.07
5.3.80.0900.06014.15
5.3.70.0730.07714.09
5.3.60.1000.06014.13
5.3.50.0930.05713.96
5.3.40.0930.05013.97
5.3.30.1000.07714.05
5.3.20.1170.06013.76
5.3.10.0730.06013.70
5.3.00.0800.08013.73
5.2.170.0930.05711.13
5.2.160.0830.05311.12
5.2.150.0870.04711.10
5.2.140.0770.05311.20
5.2.130.0670.05711.09
5.2.120.0770.03311.09
5.2.110.0930.04011.08
5.2.100.0870.04011.09
5.2.90.1100.04011.07
5.2.80.0570.04311.15
5.2.70.0830.05311.18
5.2.60.0730.05311.05
5.2.50.0730.04711.07
5.2.40.0730.04310.96
5.2.30.0530.03710.97
5.2.20.0700.03011.01
5.2.10.0600.03711.01
5.2.00.0530.04710.74
5.1.60.0630.04310.04
5.1.50.0630.05010.03
5.1.40.0530.03310.04
5.1.30.0500.05010.35
5.1.20.0830.03310.48
5.1.10.0670.02710.14
5.1.00.0530.04710.11
5.0.50.0470.0308.59
5.0.40.0200.0378.42
5.0.30.0330.0678.38
5.0.20.0600.0238.34
5.0.10.0370.0308.23
5.0.00.0400.0508.31
4.4.90.0300.0235.91
4.4.80.0270.0305.91
4.4.70.0370.0275.95
4.4.60.0600.0235.84
4.4.50.0270.0275.95
4.4.40.0270.0435.92
4.4.30.0370.0275.84
4.4.20.0370.0335.97
4.4.10.0270.0305.99
4.4.00.0200.0505.99
4.3.110.0170.0335.90
4.3.100.0500.0275.86
4.3.90.0330.0335.86
4.3.80.0400.0335.90
4.3.70.0200.0275.90
4.3.60.0270.0275.92
4.3.50.0470.0335.81
4.3.40.0470.0375.80
4.3.30.0300.0234.68
4.3.20.0200.0274.54
4.3.10.0100.0304.52
4.3.00.0000.0306.80

preferences:
40.27 ms | 401 KiB | 5 Q