3v4l.org

run code in 300+ PHP versions simultaneously
<?php // conta $videos = get_posts( array( 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-video' ), 'operator' => 'IN' ) ) ) ); $conta = count($videos); //echo $conta; //verifica if($conta == 1) { //echo 'igual a 1'; wp_reset_query(); $post_format_video_args = array( 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => -1, //'offset' => 1, //'showposts' => 1, array( 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-video' ), //'operator' => 'NOT IN', ), ), ), ); } elseif($conta > 1) { //echo 'maior que 1'; wp_reset_query(); $post_format_video_args = array( 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 1, //'offset' => 1, //'showposts' => 1, array( 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-video' ), //'operator' => 'NOT IN', ), ), ), ); } $query_post_format_video = new wp_query($post_format_video_args); //wp_reset_postdata(); //mostra while( $query_post_format_video->have_posts() ) : $query_post_format_video->the_post(); if( has_post_format( 'video' ) ){ the_content(); } endwhile; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function get_posts() in /in/uYm4g:4 Stack trace: #0 {main} thrown in /in/uYm4g on line 4
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
37.47 ms | 401 KiB | 8 Q