3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array (1=>1, 2=> 2, 3 => array(1=>11, 2=>12, 3=>13)); $text = "test"; function modarr($array, $text) { foreach ($array as $key => $arr) { if(is_array($arr)) $res[$key] = modarr($arr,$text); // modification function here else $res[$key] = $arr.$text; } return $res; } $erg = modarr($array, $text); print_r($erg);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jhnvb
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $text, !2 = $erg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'test'
   15     2        INIT_FCALL                                               'modarr'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   17     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function modarr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/jhnvb
function name:  modarr
number of ops:  21
compiled vars:  !0 = $array, !1 = $text, !2 = $arr, !3 = $key, !4 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2      > FE_RESET_R                                       $5      !0, ->18
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->18
          4    >   ASSIGN                                                   !3, ~6
    8     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~8, ->14
          7    >   INIT_FCALL_BY_NAME                                       'modarr'
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $10     
         11        ASSIGN_DIM                                               !4, !3
         12        OP_DATA                                                  $10
         13      > JMP                                                      ->17
   10    14    >   CONCAT                                           ~12     !2, !1
         15        ASSIGN_DIM                                               !4, !3
         16        OP_DATA                                                  ~12
    7    17    > > JMP                                                      ->3
         18    >   FE_FREE                                                  $5
   12    19      > RETURN                                                   !4
   13    20*     > RETURN                                                   null

End of function modarr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.49 ms | 1399 KiB | 16 Q