3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_array = array ( 'text' => '', 'attachments' => array ( 0 => array ( 'type' => 'video', 'video' => array ( 'duration' => 35, 'image' => array ( 0 => array ( 'height' => 96, 'url' => 'image1.jpg', 'width' => 130, 'with_padding' => 1, ), 1 => array ( 'height' => 120, 'url' => 'image2.jpg', 'width' => 160, 'with_padding' => 1, ), ), 'first_frame' => array ( 0 => array ( 'height' => 569, 'url' => 'image1.2.jpg', 'width' => 320, ), 1 => array ( 'height' => 284, 'url' => 'image2.2.jpg', 'width' => 160, ), ), 'width' => 720, 'height' => 1280, ), ), ), ); function recursive_my_array( $array ) { foreach ( $array as $key => $value ) { if ( ! is_array( $value ) ) continue; if ( ! array_key_exists( "width", $value ) ) continue; print "\n" . $value["url"]; } if ( is_array( $value ) ) { recursive_my_array( $value ); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMSE1
function name:  (null)
number of ops:  2
compiled vars:  !0 = $my_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   55     1      > RETURN                                                   1

Function recursive_my_array:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 16
filename:       /in/cMSE1
function name:  recursive_my_array
number of ops:  23
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
   45     1      > FE_RESET_R                                       $3      !0, ->16
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->16
          3    >   ASSIGN                                                   !2, ~4
   46     4        TYPE_CHECK                                  128  ~6      !1
          5        BOOL_NOT                                         ~7      ~6
          6      > JMPZ                                                     ~7, ->8
          7    > > JMP                                                      ->2
   47     8    >   ARRAY_KEY_EXISTS                                 ~8      'width', !1
          9        BOOL_NOT                                         ~9      ~8
         10      > JMPZ                                                     ~9, ->12
         11    > > JMP                                                      ->2
   49    12    >   FETCH_DIM_R                                      ~10     !1, 'url'
         13        CONCAT                                           ~11     '%0A', ~10
         14        ECHO                                                     ~11
   45    15      > JMP                                                      ->2
         16    >   FE_FREE                                                  $3
   52    17        TYPE_CHECK                                  128          !1
         18      > JMPZ                                                     ~12, ->22
   53    19    >   INIT_FCALL_BY_NAME                                       'recursive_my_array'
         20        SEND_VAR_EX                                              !1
         21        DO_FCALL                                      0          
   55    22    > > RETURN                                                   null

End of function recursive_my_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.71 ms | 1395 KiB | 13 Q