3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $vertical_slides_query_args = array( 'post_type' => 'vertical_slides',); $vertical_slides_query = new WP_Query( $vertical_slides_query_args ); $vertical_slides_num = 0; $outer_div_bg_img = ''; $outer_div_bg_color = ''; $outer_div_bg_pos =''; $published_posts = wp_count_posts('vertical_slides')->publish; if ( $vertical_slides_query->have_posts() ) : while ( $vertical_slides_query->have_posts() ) : $vertical_slides_query->the_post(); $vertical_slides_num++; $next_slide = $vertical_slides_num + 1; if ( has_post_thumbnail() ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id( $carousel_query->ID ), 'large' ); $outer_div_bg_img = "background-image: url(". $image[0] .")"; }else{ $outer_div_bg_img ='background-image: none'; } if (get_post_meta($post -> ID, "bg-color", true) != ""){ $outer_div_bg_color = "background-color: #" . get_post_meta($post -> ID, "bg-color", true); }else { $outer_div_bg_color = "background-color: transparent"; } if (get_post_meta($post -> ID, "bg-pos", true) != ""){ $outer_div_bg_pos = "background-position:" . get_post_meta($post -> ID, "bg-pos", true); }else{ $outer_div_bg_pos = "background-position: center center"; } ?> <div class="<?php if ($vertical_slides_num >= $published_posts) { echo 'last-slide'; } ?>" id="slide-<?php echo $vertical_slides_num; ?>"> <!-- Custom Wrapper From Fields in Post --> <?php if (get_post_meta($post -> ID, "content-wrapper-div", true) != "") { echo get_post_meta($post -> ID, "content-wrapper-div", true); } ?> <?php echo apply_filters('the_content', get_the_content()); ?> <!-- Close Custom Wrapper --> <?php if (get_post_meta($post -> ID, "content-wrapper-div", true) != "") { echo "</div>"; } ?> <?php if($vertical_slides_num < $published_posts): ?> <?php else: ?> <?php endif; ?> <?php if($id == "first-slide") { // do this } else if($id == "slide-1") { // do this } else if($id == "slide-2") { // do this } else if($id == "slide-3") { // do this } else if($id == "slide-4") { // do this } else if($id == "last-slide") { // do this } else{ // do this } ?> </section> </div>
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected 'else' (T_ELSE) in /in/FdbCj on line 67
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_ELSE in /in/FdbCj on line 67
Process exited with code 255.