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; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 22
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 22
Branch analysis from position: 33
Branch analysis from position: 22
Branch analysis from position: 30
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 17
filename:       /in/uYm4g
function name:  (null)
number of ops:  34
compiled vars:  !0 = $videos, !1 = $conta, !2 = $post_format_video_args, !3 = $query_post_format_video
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL_BY_NAME                                       'get_posts'
    7     1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0  $4      
    4     3        ASSIGN                                                   !0, $4
   15     4        COUNT                                            ~6      !0
          5        ASSIGN                                                   !1, ~6
   19     6        IS_EQUAL                                                 !1, 1
          7      > JMPZ                                                     ~8, ->12
   22     8    >   INIT_FCALL_BY_NAME                                       'wp_reset_query'
          9        DO_FCALL                                      0          
   23    10        ASSIGN                                                   !2, <array>
         11      > JMP                                                      ->17
   41    12    >   IS_SMALLER                                               1, !1
         13      > JMPZ                                                     ~11, ->17
   44    14    >   INIT_FCALL_BY_NAME                                       'wp_reset_query'
         15        DO_FCALL                                      0          
   45    16        ASSIGN                                                   !2, <array>
   64    17    >   NEW                                              $14     'wp_query'
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !3, $14
   70    21      > JMP                                                      ->30
   71    22    >   INIT_METHOD_CALL                                         !3, 'the_post'
         23        DO_FCALL                                      0          
   72    24        INIT_FCALL_BY_NAME                                       'has_post_format'
         25        SEND_VAL_EX                                              'video'
         26        DO_FCALL                                      0  $18     
         27      > JMPZ                                                     $18, ->30
   73    28    >   INIT_FCALL_BY_NAME                                       'the_content'
         29        DO_FCALL                                      0          
   70    30    >   INIT_METHOD_CALL                                         !3, 'have_posts'
         31        DO_FCALL                                      0  $20     
         32      > JMPNZ                                                    $20, ->22
   78    33    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.69 ms | 1399 KiB | 13 Q