3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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>'; } }
Output for 7.0.0 - 7.3.1
Fatal error: Uncaught Error: Call to undefined function get_the_content() in /in/bailo:3 Stack trace: #0 {main} thrown in /in/bailo on line 3
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Call to undefined function get_the_content() in /in/bailo on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/bailo on line 63
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/bailo on line 63
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/bailo on line 63
Process exited with code 255.