3v4l.org

run code in 300+ PHP versions simultaneously
<?php $MAP = [ ['x', 'x', 'x', 'x'], ['x', 's', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'x', 'x', 'x'], ]; function whatever_i_cba_naming_shit_at_this_time_of_night($data) { foreach ($data as $parentKey => $parent) { foreach ($parent as $childKey => $child) { yield [$parentKey, $childKey, $child]; } } } foreach (whatever_i_cba_naming_shit_at_this_time_of_night($MAP) as list($parentKey, $childKey, $child)) { echo "$parentKey/$childKey => $child\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 21
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 21
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/hYqR8
function name:  (null)
number of ops:  23
compiled vars:  !0 = $MAP, !1 = $parentKey, !2 = $childKey, !3 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   22     1        INIT_FCALL                                               'whatever_i_cba_naming_shit_at_this_time_of_night'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $5      
          4      > FE_RESET_R                                       $6      $5, ->21
          5    > > FE_FETCH_R                                               $6, $7, ->21
          6    >   FETCH_LIST_R                                     $8      $7, 0
          7        ASSIGN                                                   !1, $8
          8        FETCH_LIST_R                                     $10     $7, 1
          9        ASSIGN                                                   !2, $10
         10        FETCH_LIST_R                                     $12     $7, 2
         11        ASSIGN                                                   !3, $12
         12        FREE                                                     $7
   23    13        ROPE_INIT                                     6  ~15     !1
         14        ROPE_ADD                                      1  ~15     ~15, '%2F'
         15        ROPE_ADD                                      2  ~15     ~15, !2
         16        ROPE_ADD                                      3  ~15     ~15, '+%3D%3E+'
         17        ROPE_ADD                                      4  ~15     ~15, !3
         18        ROPE_END                                      5  ~14     ~15, '%0A'
         19        ECHO                                                     ~14
   22    20      > JMP                                                      ->5
         21    >   FE_FREE                                                  $6
   24    22      > RETURN                                                   1

Function whatever_i_cba_naming_shit_at_this_time_of_night:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 15
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 15
filename:       /in/hYqR8
function name:  whatever_i_cba_naming_shit_at_this_time_of_night
number of ops:  17
compiled vars:  !0 = $data, !1 = $parent, !2 = $parentKey, !3 = $child, !4 = $childKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
   15     2      > FE_RESET_R                                       $5      !0, ->15
          3    > > FE_FETCH_R                                       ~6      $5, !1, ->15
          4    >   ASSIGN                                                   !2, ~6
   16     5      > FE_RESET_R                                       $8      !1, ->13
          6    > > FE_FETCH_R                                       ~9      $8, !3, ->13
          7    >   ASSIGN                                                   !4, ~9
   17     8        INIT_ARRAY                                       ~11     !2
          9        ADD_ARRAY_ELEMENT                                ~11     !4
         10        ADD_ARRAY_ELEMENT                                ~11     !3
         11        YIELD                                                    ~11
   16    12      > JMP                                                      ->6
         13    >   FE_FREE                                                  $8
   15    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $5
   20    16      > GENERATOR_RETURN                                         

End of function whatever_i_cba_naming_shit_at_this_time_of_night

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.54 ms | 1016 KiB | 14 Q