3v4l.org

run code in 300+ PHP versions simultaneously
<?php $multidim_array = ['a' => [' \one ', ['b' => 'two\\', [['c' => 'thr\ee']]]]]; $func = 'strpos'; if (function_exists($func)) { $more = true; $param2 = 'o'; array_walk_recursive($multidim_array, function(&$v)use($func, $more, $param2) { if ($more) { $v = $func($v, $param2); } else { $v = $func($v); } }); var_export($multidim_array); } else { echo "um... I'm not calling $func"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 20
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5LUlp
function name:  (null)
number of ops:  24
compiled vars:  !0 = $multidim_array, !1 = $func, !2 = $more, !3 = $param2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 'strpos'
    4     2        INIT_FCALL                                               'function_exists'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $6      
          5      > JMPZ                                                     $6, ->20
    5     6    >   ASSIGN                                                   !2, <true>
    6     7        ASSIGN                                                   !3, 'o'
    7     8        INIT_FCALL                                               'array_walk_recursive'
          9        SEND_REF                                                 !0
         10        DECLARE_LAMBDA_FUNCTION                          ~9      [0]
         11        BIND_LEXICAL                                             ~9, !1
         12        BIND_LEXICAL                                             ~9, !2
         13        BIND_LEXICAL                                             ~9, !3
   13    14        SEND_VAL                                                 ~9
    7    15        DO_ICALL                                                 
   14    16        INIT_FCALL                                               'var_export'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
    4    19      > JMP                                                      ->23
   16    20    >   NOP                                                      
         21        FAST_CONCAT                                      ~12     'um...+I%27m+not+calling+', !1
         22        ECHO                                                     ~12
   17    23    > > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5LUlp
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $v, !1 = $func, !2 = $more, !3 = $param2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
    8     4      > JMPZ                                                     !2, ->11
    9     5    >   INIT_DYNAMIC_CALL                                        !1
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !3
          8        DO_FCALL                                      0  $4      
          9        ASSIGN                                                   !0, $4
    8    10      > JMP                                                      ->15
   11    11    >   INIT_DYNAMIC_CALL                                        !1
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0  $6      
         14        ASSIGN                                                   !0, $6
   13    15    > > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.62 ms | 1017 KiB | 16 Q