3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'name' => 'a', 'url' => 'b', ], [ 'name' => 'c', 'url' => 'd', 'children' => [ [ 'name' => 'e', 'url' => 'f' ] ] ] ]; function recurseAll(&$node, $key) { if (is_iterable($node)) { foreach ($node as $key => &$childNode) { recurseAll($childNode, $key); } } elseif ($key === "name") { $node = "***{$node}***"; } } array_walk($array, 'recurseAll'); echo "After modified by reference:\n"; var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HJc8B
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   31     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'recurseAll'
          4        DO_ICALL                                                 
   32     5        ECHO                                                     'After+modified+by+reference%3A%0A'
   33     6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function recurseall:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/HJc8B
function name:  recurseAll
number of ops:  23
compiled vars:  !0 = $node, !1 = $key, !2 = $childNode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        INIT_FCALL                                               'is_iterable'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5      > JMPZ                                                     $3, ->16
   22     6    > > FE_RESET_RW                                      $4      !0, ->14
          7    > > FE_FETCH_RW                                      ~5      $4, !2, ->14
          8    >   ASSIGN                                                   !1, ~5
   23     9        INIT_FCALL_BY_NAME                                       'recurseAll'
         10        SEND_VAR_EX                                              !2
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   22    13      > JMP                                                      ->7
         14    >   FE_FREE                                                  $4
   21    15      > JMP                                                      ->22
   25    16    >   IS_IDENTICAL                                             !1, 'name'
         17      > JMPZ                                                     ~8, ->22
   26    18    >   ROPE_INIT                                     3  ~10     '%2A%2A%2A'
         19        ROPE_ADD                                      1  ~10     ~10, !0
         20        ROPE_END                                      2  ~9      ~10, '%2A%2A%2A'
         21        ASSIGN                                                   !0, ~9
   28    22    > > RETURN                                                   null

End of function recurseall

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
278.2 ms | 1017 KiB | 16 Q