3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = get_the_content(); $description = array(); $j=0; if (preg_match_all('/<div id="description" class="description">([^<]*)<\/div>/', $content, $match)) { for( $i = 0; $i < count($match[0]); $i = $i+1 ) { $description[] = $match[0][$i]; } } $attachments =& get_children($args); $arrayMatches = array(); if ($attachments) { foreach(array_chunk($attachments, 2) as $img) { echo '<div class="two_cols">'; foreach($img as $attachment) { foreach($attachment as $attachment_key => $attachment_value) { $imageID = $attachment->ID; $imageTitle = $attachment->post_title; $imagearray = wp_get_attachment_image_src($attachment_value, $size, false); $imageAlt = get_post_meta($imageID, '_wp_attachment_image_alt', true); $imageURI = $imagearray[0]; // 0 is the URI $imageWidth = $imagearray[1]; // 1 is the width $imageHeight = $imagearray[2]; // 2 is the height ?> <div class="col_1_2"> <div id="attachment_<?php echo $imageID; ?>" class="wp-caption alignnone" style="width: 356px;"> <a rel="lightbox-0" href="<?php echo $imageURI; ?>"><img class="wp-image-<?php echo $imageID; ?> size-full" title="<?php echo $imageTitle; ?>" src="<?php echo $imageURI; ?>" alt="<?php echo $imageAlt; ?>" width="456" height="304" /></a> <p class="wp-caption-text"><?php echo $imageTitle; ?></p> <div class="full-description"><?php echo $match[0][$j];?></div> <?php //Array already declare $arrayMatches[] = $match[0][$j]; ?> </div> </div> <?php break; } $j++; } // I'm into a foreach (line 6) $result = array(); array_walk_recursive($arrayMatches, function($v, $k)use(&$result){ $result[] = $v; }); $$result = array_chunk($$result, 2); foreach($$result as $v) { echo "<div>" . implode(" ", $v) . "</div>"; } echo '</div>'; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 13
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 122
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 121
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 121
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 92
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 92
Branch analysis from position: 38
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 89
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 89
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 89
Branch analysis from position: 89
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 89
Branch analysis from position: 89
Branch analysis from position: 92
2 jumps found. (Code = 77) Position 1 = 109, Position 2 = 118
Branch analysis from position: 109
2 jumps found. (Code = 78) Position 1 = 110, Position 2 = 118
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 109
Branch analysis from position: 109
Branch analysis from position: 118
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 118
Branch analysis from position: 92
Branch analysis from position: 121
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 121
Branch analysis from position: 122
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 13
Branch analysis from position: 23
Branch analysis from position: 13
Branch analysis from position: 23
filename:       /in/bailo
function name:  (null)
number of ops:  123
compiled vars:  !0 = $content, !1 = $description, !2 = $j, !3 = $match, !4 = $i, !5 = $attachments, !6 = $args, !7 = $arrayMatches, !8 = $img, !9 = $attachment, !10 = $attachment_value, !11 = $attachment_key, !12 = $imageID, !13 = $imageTitle, !14 = $imagearray, !15 = $size, !16 = $imageAlt, !17 = $imageURI, !18 = $imageWidth, !19 = $imageHeight, !20 = $result, !21 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'get_the_content'
          1        DO_FCALL                                      0  $22     
          2        ASSIGN                                                   !0, $22
    4     3        ASSIGN                                                   !1, <array>
    5     4        ASSIGN                                                   !2, 0
    8     5        INIT_FCALL                                               'preg_match_all'
          6        SEND_VAL                                                 '%2F%3Cdiv+id%3D%22description%22+class%3D%22description%22%3E%28%5B%5E%3C%5D%2A%29%3C%5C%2Fdiv%3E%2F'
          7        SEND_VAR                                                 !0
          8        SEND_REF                                                 !3
          9        DO_ICALL                                         $26     
         10      > JMPZ                                                     $26, ->23
   11    11    >   ASSIGN                                                   !4, 0
         12      > JMP                                                      ->19
   13    13    >   FETCH_DIM_R                                      ~29     !3, 0
         14        FETCH_DIM_R                                      ~30     ~29, !4
         15        ASSIGN_DIM                                               !1
         16        OP_DATA                                                  ~30
   11    17        ADD                                              ~31     !4, 1
         18        ASSIGN                                                   !4, ~31
         19    >   FETCH_DIM_R                                      ~33     !3, 0
         20        COUNT                                            ~34     ~33
         21        IS_SMALLER                                               !4, ~34
         22      > JMPNZ                                                    ~35, ->13
   19    23    >   INIT_FCALL_BY_NAME                                       'get_children'
         24        SEND_VAR_EX                                              !6
         25        DO_FCALL                                      0  $36     
         26        ASSIGN_REF                                               !5, $36
   20    27        ASSIGN                                                   !7, <array>
   22    28      > JMPZ                                                     !5, ->122
   23    29    >   INIT_FCALL                                               'array_chunk'
         30        SEND_VAR                                                 !5
         31        SEND_VAL                                                 2
         32        DO_ICALL                                         $39     
         33      > FE_RESET_R                                       $40     $39, ->121
         34    > > FE_FETCH_R                                               $40, !8, ->121
   24    35    >   ECHO                                                     '%3Cdiv+class%3D%22two_cols%22%3E'
   25    36      > FE_RESET_R                                       $41     !8, ->92
         37    > > FE_FETCH_R                                               $41, !9, ->92
   26    38    > > FE_RESET_R                                       $42     !9, ->89
         39    > > FE_FETCH_R                                       ~43     $42, !10, ->89
         40    >   ASSIGN                                                   !11, ~43
   27    41        FETCH_OBJ_R                                      ~45     !9, 'ID'
         42        ASSIGN                                                   !12, ~45
   28    43        FETCH_OBJ_R                                      ~47     !9, 'post_title'
         44        ASSIGN                                                   !13, ~47
   29    45        INIT_FCALL_BY_NAME                                       'wp_get_attachment_image_src'
         46        SEND_VAR_EX                                              !10
         47        SEND_VAR_EX                                              !15
         48        SEND_VAL_EX                                              <false>
         49        DO_FCALL                                      0  $49     
         50        ASSIGN                                                   !14, $49
   30    51        INIT_FCALL_BY_NAME                                       'get_post_meta'
         52        SEND_VAR_EX                                              !12
         53        SEND_VAL_EX                                              '_wp_attachment_image_alt'
         54        SEND_VAL_EX                                              <true>
         55        DO_FCALL                                      0  $51     
         56        ASSIGN                                                   !16, $51
   31    57        FETCH_DIM_R                                      ~53     !14, 0
         58        ASSIGN                                                   !17, ~53
   32    59        FETCH_DIM_R                                      ~55     !14, 1
         60        ASSIGN                                                   !18, ~55
   33    61        FETCH_DIM_R                                      ~57     !14, 2
         62        ASSIGN                                                   !19, ~57
   35    63        ECHO                                                     '%09%09%09%09%09%09%09%09%09%0A%09%09%09%09%09%09%09%09%09%3Cdiv+class%3D%22col_1_2%22%3E%0A%09%09%09%09%09%09%09%09%09%09%3Cdiv+id%3D%22attachment_'
   37    64        ECHO                                                     !12
         65        ECHO                                                     '%22+class%3D%22wp-caption+alignnone%22+style%3D%22width%3A+356px%3B%22%3E%0A%09%09%09%09%09%09%09%09%09%09%09%3Ca+rel%3D%22lightbox-0%22++href%3D%22'
   38    66        ECHO                                                     !17
         67        ECHO                                                     '%22%3E%3Cimg+class%3D%22wp-image-'
         68        ECHO                                                     !12
         69        ECHO                                                     '+size-full%22+title%3D%22'
         70        ECHO                                                     !13
         71        ECHO                                                     '%22+src%3D%22'
         72        ECHO                                                     !17
         73        ECHO                                                     '%22+alt%3D%22'
         74        ECHO                                                     !16
         75        ECHO                                                     '%22+width%3D%22456%22+height%3D%22304%22+%2F%3E%3C%2Fa%3E%0A%09%09%09%09%09%09%09%09%09%09%09%3Cp+class%3D%22wp-caption-text%22%3E'
   39    76        ECHO                                                     !13
         77        ECHO                                                     '%3C%2Fp%3E%0A%09%09%09%09%09%09%09%09%09%09%09%3Cdiv+class%3D%22full-description%22%3E'
   40    78        FETCH_DIM_R                                      ~59     !3, 0
         79        FETCH_DIM_R                                      ~60     ~59, !2
         80        ECHO                                                     ~60
         81        ECHO                                                     '%3C%2Fdiv%3E%0A%09%09%09%09%09%09%09%09%09%09%09'
   44    82        FETCH_DIM_R                                      ~62     !3, 0
         83        FETCH_DIM_R                                      ~63     ~62, !2
         84        ASSIGN_DIM                                               !7
         85        OP_DATA                                                  ~63
   47    86        ECHO                                                     '%09%09%09%09%09%09%09%09%09%09%3C%2Fdiv%3E%0A%09%09%09%09%09%09%09%09%09%3C%2Fdiv%3E%0A%09%09%09%09%09%09%09%09%09%0A%09%09%09%09%09%09%09%09%09%09%09%09%0A%09%09%09%09%09%09%09%09'
   53    87      > JMP                                                      ->89
   26    88*       JMP                                                      ->39
         89    >   FE_FREE                                                  $42
   57    90        PRE_INC                                                  !2
   25    91      > JMP                                                      ->37
         92    >   FE_FREE                                                  $41
   61    93        ASSIGN                                                   !20, <array>
   63    94        INIT_FCALL                                               'array_walk_recursive'
         95        SEND_REF                                                 !7
         96        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fbailo%3A63%240'
         97        BIND_LEXICAL                                             ~66, !20
   65    98        SEND_VAL                                                 ~66
         99        DO_ICALL                                                 
   67   100        INIT_FCALL                                               'array_chunk'
        101        FETCH_R                      local               ~69     !20
        102        SEND_VAL                                                 ~69
        103        SEND_VAL                                                 2
        104        DO_ICALL                                         $70     
        105        FETCH_W                      local               $68     !20
        106        ASSIGN                                                   $68, $70
   69   107        FETCH_R                      local               ~72     !20
        108      > FE_RESET_R                                       $73     ~72, ->118
        109    > > FE_FETCH_R                                               $73, !21, ->118
   70   110    >   INIT_FCALL                                               'implode'
        111        SEND_VAL                                                 '+'
        112        SEND_VAR                                                 !21
        113        DO_ICALL                                         $74     
        114        CONCAT                                           ~75     '%3Cdiv%3E', $74
        115        CONCAT                                           ~76     ~75, '%3C%2Fdiv%3E'
        116        ECHO                                                     ~76
   69   117      > JMP                                                      ->109
        118    >   FE_FREE                                                  $73
   74   119        ECHO                                                     '%3C%2Fdiv%3E'
   23   120      > JMP                                                      ->34
        121    >   FE_FREE                                                  $40
   80   122    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fbailo%3A63%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bailo
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $v, !1 = $k, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   64     3        ASSIGN_DIM                                               !2
          4        OP_DATA                                                  !0
   65     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fbailo%3A63%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.69 ms | 1408 KiB | 21 Q