3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sweet = array('a' => 'apple', 'b' => 'banana'); $fruits = array('sweet' => $sweet, 'sour' => 'lemon'); $arr = array('data-object.url' => 'http://yamamotohi.beautist.dev-php55.istyle.local/beautist/article/2004580', 'data-object.parent.class' => 'blog', 'data-object.parent.id' => '2004580', 'data-object.parent.owner.class' =>'uid', 'data-object.parent.owner.id' => '101607419', ); function test_print($item, $key) { echo "$key holds $item\n"; } array_walk_recursive($fruits, 'test_print'); array_walk_recursive($arr, function($item, $key){ echo "$key=\"$item\"\n"; }); $str = ''; array_walk_recursive($arr, function($item, $key){ $str .= vsprintf("$key=\"$item\"\n"); }); var_dump($str); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kq5W1
function name:  (null)
number of ops:  24
compiled vars:  !0 = $sweet, !1 = $fruits, !2 = $arr, !3 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_ARRAY                                       ~5      !0, 'sweet'
          2        ADD_ARRAY_ELEMENT                                ~5      'lemon', 'sour'
          3        ASSIGN                                                   !1, ~5
    6     4        ASSIGN                                                   !2, <array>
   18     5        INIT_FCALL                                               'array_walk_recursive'
          6        SEND_REF                                                 !1
          7        SEND_VAL                                                 'test_print'
          8        DO_ICALL                                                 
   20     9        INIT_FCALL                                               'array_walk_recursive'
         10        SEND_REF                                                 !2
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fkq5W1%3A20%240'
   22    12        SEND_VAL                                                 ~9
         13        DO_ICALL                                                 
   24    14        ASSIGN                                                   !3, ''
   25    15        INIT_FCALL                                               'array_walk_recursive'
         16        SEND_REF                                                 !2
         17        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fkq5W1%3A25%241'
   27    18        SEND_VAL                                                 ~12
         19        DO_ICALL                                                 
   29    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
   30    23      > RETURN                                                   1

Function test_print:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kq5W1
function name:  test_print
number of ops:  8
compiled vars:  !0 = $item, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ROPE_INIT                                     4  ~3      !1
          3        ROPE_ADD                                      1  ~3      ~3, '+holds+'
          4        ROPE_ADD                                      2  ~3      ~3, !0
          5        ROPE_END                                      3  ~2      ~3, '%0A'
          6        ECHO                                                     ~2
   16     7      > RETURN                                                   null

End of function test_print

Function %00%7Bclosure%7D%2Fin%2Fkq5W1%3A20%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kq5W1
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $item, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        ROPE_INIT                                     4  ~3      !1
          3        ROPE_ADD                                      1  ~3      ~3, '%3D%22'
          4        ROPE_ADD                                      2  ~3      ~3, !0
          5        ROPE_END                                      3  ~2      ~3, '%22%0A'
          6        ECHO                                                     ~2
   22     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fkq5W1%3A20%240

Function %00%7Bclosure%7D%2Fin%2Fkq5W1%3A25%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kq5W1
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $item, !1 = $key, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   26     2        INIT_FCALL                                               'vsprintf'
          3        ROPE_INIT                                     4  ~4      !1
          4        ROPE_ADD                                      1  ~4      ~4, '%3D%22'
          5        ROPE_ADD                                      2  ~4      ~4, !0
          6        ROPE_END                                      3  ~3      ~4, '%22%0A'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                         $6      
          9        ASSIGN_OP                                     8          !2, $6
   27    10      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fkq5W1%3A25%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.16 ms | 1400 KiB | 19 Q