3v4l.org

run code in 300+ PHP versions simultaneously
<?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>

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)
5.4.280.0100.05319.15
5.4.270.0030.06318.85
5.4.260.0030.06019.22
5.4.250.0030.05318.94
5.4.240.0030.07718.98
5.4.230.0070.05718.98
5.4.220.0030.06719.21
5.4.210.0070.07019.16
5.4.200.0030.06718.97
5.4.190.0070.05319.24
5.4.180.0000.07719.07
5.4.170.0030.07719.08
5.4.160.0000.05019.07
5.4.150.0030.06319.29
5.4.140.0070.06716.33
5.4.130.0030.06716.33
5.4.120.0000.05716.31
5.4.110.0000.07716.56
5.4.100.0100.07016.51
5.4.90.0030.07016.45
5.4.80.0000.06316.39
5.4.70.0070.07016.44
5.4.60.0070.07016.40
5.4.50.0000.07316.39
5.4.40.0030.06016.56
5.4.30.0100.03716.54
5.4.20.0070.06716.44
5.4.10.0000.07316.43
5.4.00.0030.07315.80
5.3.280.0070.06714.45
5.3.270.0100.07014.53
5.3.260.0000.07314.67
5.3.250.0030.07314.53
5.3.240.0000.07714.47
5.3.230.0000.06714.46
5.3.220.0030.07014.53
5.3.210.0070.05714.63
5.3.200.0070.07314.43
5.3.190.0100.06314.43
5.3.180.0030.07714.53
5.3.170.0000.05714.53
5.3.160.0030.07014.46
5.3.150.0000.06314.49
5.3.140.0070.06714.63
5.3.130.0000.07314.42
5.3.120.0100.07714.39
5.3.110.0070.07314.43
5.3.100.0030.07013.93
5.3.90.0070.07014.02
5.3.80.0100.06713.98
5.3.70.0070.06014.02
5.3.60.0030.07013.86
5.3.50.0030.06314.00
5.3.40.0030.05713.84
5.3.30.0000.07713.80
5.3.20.0030.07713.58
5.3.10.0000.07013.47
5.3.00.0070.05013.75

preferences:
135.19 ms | 1394 KiB | 7 Q