3v4l.org

run code in 300+ PHP versions simultaneously
<?php $j=[ ['type' => ['href' => 'http://foo.bar']], ['embedded' => [['type' => ['href' => 'http://foo.bar']]] ]]; array_walk_recursive($j, function(&$v, $k) { if ($k == 'type') { print $k; print_r($v); $v['href'] = str_replace('foo', 'foz', $v['href']); } }); print_r($j);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Luii
function name:  (null)
number of ops:  10
compiled vars:  !0 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'array_walk_recursive'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1Luii%3A7%240'
   13     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   14     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F1Luii%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/1Luii
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $v, !1 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        IS_EQUAL                                                 !1, 'type'
          3      > JMPZ                                                     ~2, ->16
    9     4    >   ECHO                                                     !1
   10     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   11     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAL                                                 'foo'
         10        SEND_VAL                                                 'foz'
         11        FETCH_DIM_R                                      ~5      !0, 'href'
         12        SEND_VAL                                                 ~5
         13        DO_ICALL                                         $6      
         14        ASSIGN_DIM                                               !0, 'href'
         15        OP_DATA                                                  $6
   13    16    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1Luii%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.15 ms | 1396 KiB | 19 Q