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 $y => $row) { foreach ($row as $x => $cell) { yield ['x' => $x, 'y' => $y] => $cell; } } } foreach (whatever_i_cba_naming_shit_at_this_time_of_night($MAP) as $coordinates => $cell) { echo "{$coordinates['x']}/{$coordinates['y']} => $cell\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/CAbX4
function name:  (null)
number of ops:  19
compiled vars:  !0 = $MAP, !1 = $cell, !2 = $coordinates
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  $4      
          4      > FE_RESET_R                                       $5      $4, ->17
          5    > > FE_FETCH_R                                       ~6      $5, !1, ->17
          6    >   ASSIGN                                                   !2, ~6
   23     7        FETCH_DIM_R                                      ~8      !2, 'x'
          8        ROPE_INIT                                     6  ~11     ~8
          9        ROPE_ADD                                      1  ~11     ~11, '%2F'
         10        FETCH_DIM_R                                      ~9      !2, 'y'
         11        ROPE_ADD                                      2  ~11     ~11, ~9
         12        ROPE_ADD                                      3  ~11     ~11, '+%3D%3E+'
         13        ROPE_ADD                                      4  ~11     ~11, !1
         14        ROPE_END                                      5  ~10     ~11, '%0A'
         15        ECHO                                                     ~10
   22    16      > JMP                                                      ->5
         17    >   FE_FREE                                                  $5
   24    18      > 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 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 14
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 14
filename:       /in/CAbX4
function name:  whatever_i_cba_naming_shit_at_this_time_of_night
number of ops:  16
compiled vars:  !0 = $data, !1 = $row, !2 = $y, !3 = $cell, !4 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
   15     2      > FE_RESET_R                                       $5      !0, ->14
          3    > > FE_FETCH_R                                       ~6      $5, !1, ->14
          4    >   ASSIGN                                                   !2, ~6
   16     5      > FE_RESET_R                                       $8      !1, ->12
          6    > > FE_FETCH_R                                       ~9      $8, !3, ->12
          7    >   ASSIGN                                                   !4, ~9
   17     8        INIT_ARRAY                                       ~11     !4, 'x'
          9        ADD_ARRAY_ELEMENT                                ~11     !2, 'y'
         10        YIELD                                                    !3, ~11
   16    11      > JMP                                                      ->6
         12    >   FE_FREE                                                  $8
   15    13      > JMP                                                      ->3
         14    >   FE_FREE                                                  $5
   20    15      > 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:
144 ms | 1016 KiB | 14 Q