3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Work Block */ if(!class_exists('ST_Portfolio_Block')) { class ST_Portfolio_Block extends AQ_Block { function __construct() { $block_options = array( 'name' => '<i class="fa fa-archive"></i> Portfolio', 'size' => 'col-md-12', ); //create the widget parent::__construct('st_portfolio_block', $block_options); } function form($instance){ $defaults = array( 'title' => 'Title Portfolio', 'show' => '4', 'orderby' => 'title', 'orderpost' => 'ASC' ); $instance = wp_parse_args($instance, $defaults); extract($instance); $orderpost_options = array ( 'ASC' => 'ASC : lowest to highest', 'DESC' => 'DESC : highest to lowest', ); $orderby_options = array ( 'title' => 'Title', 'date' => 'Date', 'rand' => 'Random' ); ?> <h3 style="text-align: center;">Portfolio</h3> <div class="description"> <label for="<?php echo $this->get_field_id('title') ?>"> Title<br/><em style="font-size: 0.8em;">(Please enter title portfolio)</em><br/> <?php echo aq_field_input('title', $block_id, $title, $size = 'full') ?> </label> </div> <div class="cf"></div> <div class="description third"> <label for="<?php echo $this->get_field_id('show') ?>"> Show portfolio<br/><em style="font-size: 0.8em;">(Chosen number portfolio. Ex: 6)</em><br/> <?php echo aq_field_input('show', $block_id, $show, $size = 'full',$type = 'number') ?> </label> </div> <div class="description third"> <label for="<?php echo $this->get_field_id('orderpost') ?>"> Sort Order<br/><em style="font-size: 0.8em;">Sort from lowest to highest (Default)</em><br/> <?php echo aq_field_select('orderpost', $block_id, $orderpost_options, $orderpost, $size = 'full') ?> </label> </div> <div class="description third last"> <label for="<?php echo $this->get_field_id('orderby') ?>"> Order by<br/><em style="font-size: 0.8em;">Title (Default)</em><br/> <?php echo aq_field_select('orderby', $block_id, $orderby_options, $orderby, $size = 'full') ?> </label> </div> <div class="cf"></div> <?php } function block($instance){ extract($instance); $title1 = (!empty($title) ? ' '.esc_attr($title) : ''); $desc1 = (!empty($subtitle) ? ' '.esc_attr($subtitle) : ''); $show1 = (!empty($show) ? ' '.esc_attr($show) : ''); $text1 = (!empty($text) ? ' '.esc_attr($text) : ''); ?> <!-- Container --> <div class="container"> <!-- Headline --> <div class="fiveteen columns"> <div class="container"> <h3 class="headline"><?php echo htmlspecialchars_decode($title1); ?></h3> <span class="line" style="margin-bottom:35px;"></span> </div> <ul class="grid cs-style"> <?php $args = array( 'post_type' => 'portfolio', 'posts_per_page' => $show1, 'order' => $orderpost, 'orderby' => $orderby, ); $wp_query = new WP_Query($args); $i = 1; while ($wp_query -> have_posts()) : $wp_query -> the_post(); $cates = get_the_terms(get_the_ID(),'categories'); $cate_name =''; $cate_slug = ''; foreach((array)$cates as $cate){ if(count($cates)>0){ $cate_name .= $cate->name.' ' ; $cate_slug .= $cate->slug .' '; } } ?> <li> <figure> <?php $params = array( 'width' => 573, 'height' => 394 ); $image = bfi_thumb( wp_get_attachment_url(get_post_thumbnail_id()), $params ); ?> <img src="<?php echo $image; ?>" alt="<?php the_title(); ?>"/> <figcaption> <h3><?php the_title();?></h3> <span><?php echo $cate_name;?></span> <a href="<?php the_permalink(); ?>"><?php global $theme_option; echo $theme_option['portfolio_read']; ?></a> </figcaption> </figure> </li> <?php $i++; endwhile;?> </ul> <div class="clearfix"></div> </div> </div> <!-- Container / End --> <? } function update($new_instance, $old_instance) { $new_instance = aq_recursive_sanitize($new_instance); return $new_instance; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/0NWJf
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'class_exists'
          1        SEND_VAL                                                 'ST_Portfolio_Block'
          2        DO_ICALL                                         $0      
          3        BOOL_NOT                                         ~1      $0
          4      > JMPZ                                                     ~1, ->6
    4     5    >   DECLARE_CLASS                                            'st_portfolio_block', 'aq_block'
  131     6    > > RETURN                                                   1

Class ST_Portfolio_Block:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0NWJf
function name:  __construct
number of ops:  6
compiled vars:  !0 = $block_options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAL_EX                                              'st_portfolio_block'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   14     5      > RETURN                                                   null

End of function __construct

Function form:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0NWJf
function name:  form
number of ops:  74
compiled vars:  !0 = $instance, !1 = $defaults, !2 = $orderpost_options, !3 = $orderby_options, !4 = $block_id, !5 = $title, !6 = $size, !7 = $show, !8 = $type, !9 = $orderpost, !10 = $orderby
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        ASSIGN                                                   !1, <array>
   23     2        INIT_FCALL_BY_NAME                                       'wp_parse_args'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $12     
          6        ASSIGN                                                   !0, $12
   24     7        INIT_FCALL                                               'extract'
          8        SEND_REF                                                 !0
          9        DO_ICALL                                                 
   25    10        ASSIGN                                                   !2, <array>
   30    11        ASSIGN                                                   !3, <array>
   36    12        ECHO                                                     '++++++++%3Ch3+style%3D%22text-align%3A+center%3B%22%3EPortfolio%3C%2Fh3%3E%0A%09%09%3Cdiv+class%3D%22description%22%3E%0A%09++++++++%3Clabel+for%3D%22'
   38    13        INIT_METHOD_CALL                                         'get_field_id'
         14        SEND_VAL_EX                                              'title'
         15        DO_FCALL                                      0  $17     
         16        ECHO                                                     $17
         17        ECHO                                                     '%22%3E%0A%09++++++++Title%3Cbr%2F%3E%3Cem+style%3D%22font-size%3A+0.8em%3B%22%3E%28Please+enter+title+portfolio%29%3C%2Fem%3E%3Cbr%2F%3E%0A%09++++++++'
   40    18        INIT_FCALL_BY_NAME                                       'aq_field_input'
         19        SEND_VAL_EX                                              'title'
         20        SEND_VAR_EX                                              !4
         21        SEND_VAR_EX                                              !5
         22        ASSIGN                                           ~18     !6, 'full'
         23        SEND_VAL_EX                                              ~18
         24        DO_FCALL                                      0  $19     
         25        ECHO                                                     $19
   41    26        ECHO                                                     '%09++++++++%3C%2Flabel%3E%0A%09++++%3C%2Fdiv%3E%0A%09%09%3Cdiv+class%3D%22cf%22%3E%3C%2Fdiv%3E%0A++++%09%3Cdiv+class%3D%22description+third%22%3E%0A++++%09%09%3Clabel+for%3D%22'
   45    27        INIT_METHOD_CALL                                         'get_field_id'
         28        SEND_VAL_EX                                              'show'
         29        DO_FCALL                                      0  $20     
         30        ECHO                                                     $20
         31        ECHO                                                     '%22%3E%0A++++%09%09%09Show+portfolio%3Cbr%2F%3E%3Cem+style%3D%22font-size%3A+0.8em%3B%22%3E%28Chosen+number+portfolio.+Ex%3A+6%29%3C%2Fem%3E%3Cbr%2F%3E%0A++++%09%09%09'
   47    32        INIT_FCALL_BY_NAME                                       'aq_field_input'
         33        SEND_VAL_EX                                              'show'
         34        SEND_VAR_EX                                              !4
         35        SEND_VAR_EX                                              !7
         36        ASSIGN                                           ~21     !6, 'full'
         37        SEND_VAL_EX                                              ~21
         38        ASSIGN                                           ~22     !8, 'number'
         39        SEND_VAL_EX                                              ~22
         40        DO_FCALL                                      0  $23     
         41        ECHO                                                     $23
   48    42        ECHO                                                     '++++%09%09%3C%2Flabel%3E%0A++++%09%3C%2Fdiv%3E%0A%09%09%3Cdiv+class%3D%22description+third%22%3E%0A++++%09%09%3Clabel+for%3D%22'
   51    43        INIT_METHOD_CALL                                         'get_field_id'
         44        SEND_VAL_EX                                              'orderpost'
         45        DO_FCALL                                      0  $24     
         46        ECHO                                                     $24
         47        ECHO                                                     '%22%3E%0A++++%09%09%09Sort+Order%3Cbr%2F%3E%3Cem+style%3D%22font-size%3A+0.8em%3B%22%3ESort+from+lowest+to+highest+%28Default%29%3C%2Fem%3E%3Cbr%2F%3E%0A++++%09%09%09'
   53    48        INIT_FCALL_BY_NAME                                       'aq_field_select'
         49        SEND_VAL_EX                                              'orderpost'
         50        SEND_VAR_EX                                              !4
         51        SEND_VAR_EX                                              !2
         52        SEND_VAR_EX                                              !9
         53        ASSIGN                                           ~25     !6, 'full'
         54        SEND_VAL_EX                                              ~25
         55        DO_FCALL                                      0  $26     
         56        ECHO                                                     $26
   54    57        ECHO                                                     '++++%09%09%3C%2Flabel%3E%0A++++%09%3C%2Fdiv%3E%0A%09%09%3Cdiv+class%3D%22description+third+last%22%3E%0A++++%09%09%3Clabel+for%3D%22'
   57    58        INIT_METHOD_CALL                                         'get_field_id'
         59        SEND_VAL_EX                                              'orderby'
         60        DO_FCALL                                      0  $27     
         61        ECHO                                                     $27
         62        ECHO                                                     '%22%3E%0A++++%09%09%09Order+by%3Cbr%2F%3E%3Cem+style%3D%22font-size%3A+0.8em%3B%22%3ETitle+%28Default%29%3C%2Fem%3E%3Cbr%2F%3E%0A++++%09%09%09'
   59    63        INIT_FCALL_BY_NAME                                       'aq_field_select'
         64        SEND_VAL_EX                                              'orderby'
         65        SEND_VAR_EX                                              !4
         66        SEND_VAR_EX                                              !3
         67        SEND_VAR_EX                                              !10
         68        ASSIGN                                           ~28     !6, 'full'
         69        SEND_VAL_EX                                              ~28
         70        DO_FCALL                                      0  $29     
         71        ECHO                                                     $29
   60    72        ECHO                                                     '++++%09%09%3C%2Flabel%3E%0A++++%09%3C%2Fdiv%3E%0A%09%09%0A%09%09%3Cdiv+class%3D%22cf%22%3E%3C%2Fdiv%3E%0A++++++++'
   65    73      > RETURN                                                   null

End of function form

Function block:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 121
Branch analysis from position: 121
2 jumps found. (Code = 44) Position 1 = 124, Position 2 = 65
Branch analysis from position: 124
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 65
2 jumps found. (Code = 77) Position 1 = 78, Position 2 = 89
Branch analysis from position: 78
2 jumps found. (Code = 78) Position 1 = 79, Position 2 = 89
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 88
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 78
Branch analysis from position: 78
Branch analysis from position: 88
Branch analysis from position: 89
2 jumps found. (Code = 44) Position 1 = 124, Position 2 = 65
Branch analysis from position: 124
Branch analysis from position: 65
Branch analysis from position: 89
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
Branch analysis from position: 46
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
Branch analysis from position: 35
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
Branch analysis from position: 24
filename:       /in/0NWJf
function name:  block
number of ops:  126
compiled vars:  !0 = $instance, !1 = $title1, !2 = $title, !3 = $desc1, !4 = $subtitle, !5 = $show1, !6 = $show, !7 = $text1, !8 = $text, !9 = $args, !10 = $orderpost, !11 = $orderby, !12 = $wp_query, !13 = $i, !14 = $cates, !15 = $cate_name, !16 = $cate_slug, !17 = $cate, !18 = $params, !19 = $image, !20 = $theme_option
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   66     0  E >   RECV                                             !0      
   67     1        INIT_FCALL                                               'extract'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
   68     4        ISSET_ISEMPTY_CV                                 ~22     !2
          5        BOOL_NOT                                         ~23     ~22
          6      > JMPZ                                                     ~23, ->13
          7    >   INIT_FCALL_BY_NAME                                       'esc_attr'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $24     
         10        CONCAT                                           ~25     '+', $24
         11        QM_ASSIGN                                        ~26     ~25
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~26     ''
         14    >   ASSIGN                                                   !1, ~26
   69    15        ISSET_ISEMPTY_CV                                 ~28     !4
         16        BOOL_NOT                                         ~29     ~28
         17      > JMPZ                                                     ~29, ->24
         18    >   INIT_FCALL_BY_NAME                                       'esc_attr'
         19        SEND_VAR_EX                                              !4
         20        DO_FCALL                                      0  $30     
         21        CONCAT                                           ~31     '+', $30
         22        QM_ASSIGN                                        ~32     ~31
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~32     ''
         25    >   ASSIGN                                                   !3, ~32
   70    26        ISSET_ISEMPTY_CV                                 ~34     !6
         27        BOOL_NOT                                         ~35     ~34
         28      > JMPZ                                                     ~35, ->35
         29    >   INIT_FCALL_BY_NAME                                       'esc_attr'
         30        SEND_VAR_EX                                              !6
         31        DO_FCALL                                      0  $36     
         32        CONCAT                                           ~37     '+', $36
         33        QM_ASSIGN                                        ~38     ~37
         34      > JMP                                                      ->36
         35    >   QM_ASSIGN                                        ~38     ''
         36    >   ASSIGN                                                   !5, ~38
   71    37        ISSET_ISEMPTY_CV                                 ~40     !8
         38        BOOL_NOT                                         ~41     ~40
         39      > JMPZ                                                     ~41, ->46
         40    >   INIT_FCALL_BY_NAME                                       'esc_attr'
         41        SEND_VAR_EX                                              !8
         42        DO_FCALL                                      0  $42     
         43        CONCAT                                           ~43     '+', $42
         44        QM_ASSIGN                                        ~44     ~43
         45      > JMP                                                      ->47
         46    >   QM_ASSIGN                                        ~44     ''
         47    >   ASSIGN                                                   !7, ~44
   73    48        ECHO                                                     '%09%0A%09%3C%21--+Container+--%3E%0A%3Cdiv+class%3D%22container%22%3E%0A%0A%09%3C%21--+Headline+--%3E%0A%3Cdiv+class%3D%22fiveteen+columns%22%3E%0A++++%3Cdiv+class%3D%22container%22%3E%0A%09%09%3Ch3+class%3D%22headline%22%3E'
   80    49        INIT_FCALL                                               'htmlspecialchars_decode'
         50        SEND_VAR                                                 !1
         51        DO_ICALL                                         $46     
         52        ECHO                                                     $46
         53        ECHO                                                     '%3C%2Fh3%3E%0A%09%09%3Cspan+class%3D%22line%22+style%3D%22margin-bottom%3A35px%3B%22%3E%3C%2Fspan%3E%0A%09++%3C%2Fdiv%3E%0A%09%09%09%3Cul+class%3D%22grid+cs-style%22%3E%0A%09%09%09'
   86    54        INIT_ARRAY                                       ~47     'portfolio', 'post_type'
   87    55        ADD_ARRAY_ELEMENT                                ~47     !5, 'posts_per_page'
   88    56        ADD_ARRAY_ELEMENT                                ~47     !10, 'order'
   89    57        ADD_ARRAY_ELEMENT                                ~47     !11, 'orderby'
   85    58        ASSIGN                                                   !9, ~47
   91    59        NEW                                              $49     'WP_Query'
         60        SEND_VAR_EX                                              !9
         61        DO_FCALL                                      0          
         62        ASSIGN                                                   !12, $49
   92    63        ASSIGN                                                   !13, 1
   93    64      > JMP                                                      ->121
         65    >   INIT_METHOD_CALL                                         !12, 'the_post'
         66        DO_FCALL                                      0          
   94    67        INIT_FCALL_BY_NAME                                       'get_the_terms'
         68        INIT_FCALL_BY_NAME                                       'get_the_ID'
         69        DO_FCALL                                      0  $54     
         70        SEND_VAR_NO_REF_EX                                       $54
         71        SEND_VAL_EX                                              'categories'
         72        DO_FCALL                                      0  $55     
         73        ASSIGN                                                   !14, $55
   95    74        ASSIGN                                                   !15, ''
   96    75        ASSIGN                                                   !16, ''
   97    76        CAST                                          7  ~59     !14
         77      > FE_RESET_R                                       $60     ~59, ->89
         78    > > FE_FETCH_R                                               $60, !17, ->89
   98    79    >   COUNT                                            ~61     !14
         80        IS_SMALLER                                               0, ~61
         81      > JMPZ                                                     ~62, ->88
   99    82    >   FETCH_OBJ_R                                      ~63     !17, 'name'
         83        CONCAT                                           ~64     ~63, '+'
         84        ASSIGN_OP                                     8          !15, ~64
  100    85        FETCH_OBJ_R                                      ~66     !17, 'slug'
         86        CONCAT                                           ~67     ~66, '+'
         87        ASSIGN_OP                                     8          !16, ~67
   97    88    > > JMP                                                      ->78
         89    >   FE_FREE                                                  $60
  103    90        ECHO                                                     '%09%0A%09%09%09%09%09%3Cli%3E%0A%09%09%09%09%09%09%3Cfigure%3E%0A%09%09%09%09%09%09%09'
  106    91        ASSIGN                                                   !18, <array>
  107    92        INIT_FCALL_BY_NAME                                       'bfi_thumb'
         93        INIT_FCALL_BY_NAME                                       'wp_get_attachment_url'
         94        INIT_FCALL_BY_NAME                                       'get_post_thumbnail_id'
         95        DO_FCALL                                      0  $70     
         96        SEND_VAR_NO_REF_EX                                       $70
         97        DO_FCALL                                      0  $71     
         98        SEND_VAR_NO_REF_EX                                       $71
         99        SEND_VAR_EX                                              !18
        100        DO_FCALL                                      0  $72     
        101        ASSIGN                                                   !19, $72
  108   102        ECHO                                                     '%09%09%09%09%09%09%09%3Cimg+src%3D%22'
        103        ECHO                                                     !19
        104        ECHO                                                     '%22+alt%3D%22'
        105        INIT_FCALL_BY_NAME                                       'the_title'
        106        DO_FCALL                                      0          
        107        ECHO                                                     '%22%2F%3E%0A%09%09%09%09%09%09%09%3Cfigcaption%3E%0A%09%09%09%09%09%09%09%09%3Ch3%3E'
  110   108        INIT_FCALL_BY_NAME                                       'the_title'
        109        DO_FCALL                                      0          
        110        ECHO                                                     '%3C%2Fh3%3E%0A%09%09%09%09%09%09%09%09%3Cspan%3E'
  111   111        ECHO                                                     !15
        112        ECHO                                                     '%3C%2Fspan%3E%0A%09%09%09%09%09%09%09%09%3Ca+href%3D%22'
  112   113        INIT_FCALL_BY_NAME                                       'the_permalink'
        114        DO_FCALL                                      0          
        115        ECHO                                                     '%22%3E'
        116        BIND_GLOBAL                                              !20, 'theme_option'
        117        FETCH_DIM_R                                      ~77     !20, 'portfolio_read'
        118        ECHO                                                     ~77
        119        ECHO                                                     '%3C%2Fa%3E%0A%09%09%09%09%09%09%09%3C%2Ffigcaption%3E%0A%09%09%09%09%09%09%3C%2Ffigure%3E%0A%09%09%09%09%09%3C%2Fli%3E%0A%09%09%09%09'
  116   120        PRE_INC                                                  !13
   93   121    >   INIT_METHOD_CALL                                         !12, 'have_posts'
        122        DO_FCALL                                      0  $79     
        123      > JMPNZ                                                    $79, ->65
  118   124    >   ECHO                                                     '%09%09%09%3C%2Ful%3E%0A%09%09%09%3Cdiv+class%3D%22clearfix%22%3E%3C%2Fdiv%3E%0A+++++%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3C%21--+Container+%2F+End+--%3E%0A%0A++++'
  125   125      > RETURN                                                   null

End of function block

Function update:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0NWJf
function name:  update
number of ops:  8
compiled vars:  !0 = $new_instance, !1 = $old_instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  126     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  127     2        INIT_FCALL_BY_NAME                                       'aq_recursive_sanitize'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
  128     6      > RETURN                                                   !0
  129     7*     > RETURN                                                   null

End of function update

End of class ST_Portfolio_Block.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.92 ms | 1420 KiB | 19 Q