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) { print $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/3MTJQ
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%2F3MTJQ%3A7%240'
   14     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   15     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3MTJQ%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/3MTJQ
function name:  {closure}
number of ops:  18
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        ECHO                                                     !1
    9     3        IS_EQUAL                                                 !1, 'type'
          4      > JMPZ                                                     ~2, ->17
   10     5    >   ECHO                                                     !1
   11     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   12     9        INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 'foo'
         11        SEND_VAL                                                 'foz'
         12        FETCH_DIM_R                                      ~5      !0, 'href'
         13        SEND_VAL                                                 ~5
         14        DO_ICALL                                         $6      
         15        ASSIGN_DIM                                               !0, 'href'
         16        OP_DATA                                                  $6
   14    17    > > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.9 ms | 1396 KiB | 19 Q