3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function func(&$data) { foreach ($data as $key => $value) { if (is_array($value)) { func($data[$key]); } } } $data = [ ['k' => [0]], ['k' => [1]], ]; ob_start(); debug_zval_dump($data[1]['k']); echo substr(ob_get_clean(), 9, 11)."\n"; func($data); ob_start(); debug_zval_dump($data[1]['k']); echo substr(ob_get_clean(), 9, 11)."\n"; array_replace_recursive($data[0], $data[1]); echo json_encode($data);
based on A4iBv
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RnPX8
function name:  (null)
number of ops:  48
compiled vars:  !0 = $data
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  11     1        ASSIGN                                                   !0, <array>
  15     2        INIT_FCALL                                               'ob_start'
         3        DO_ICALL                                                 
         4        INIT_FCALL                                               'debug_zval_dump'
         5        FETCH_DIM_R                                      $3      !0, 1
         6        FETCH_DIM_R                                      $4      $3, 'k'
         7        SEND_VAR                                                 $4
         8        DO_ICALL                                                 
         9        INIT_FCALL                                               'substr'
        10        INIT_FCALL                                               'ob_get_clean'
        11        DO_ICALL                                         $6      
        12        SEND_VAR                                                 $6
        13        SEND_VAL                                                 9
        14        SEND_VAL                                                 11
        15        DO_ICALL                                         $7      
        16        CONCAT                                           ~8      $7, '%0A'
        17        ECHO                                                     ~8
  16    18        INIT_FCALL                                               'func'
        19        SEND_REF                                                 !0
        20        DO_FCALL                                      0          
  17    21        INIT_FCALL                                               'ob_start'
        22        DO_ICALL                                                 
        23        INIT_FCALL                                               'debug_zval_dump'
        24        FETCH_DIM_R                                      $11     !0, 1
        25        FETCH_DIM_R                                      $12     $11, 'k'
        26        SEND_VAR                                                 $12
        27        DO_ICALL                                                 
        28        INIT_FCALL                                               'substr'
        29        INIT_FCALL                                               'ob_get_clean'
        30        DO_ICALL                                         $14     
        31        SEND_VAR                                                 $14
        32        SEND_VAL                                                 9
        33        SEND_VAL                                                 11
        34        DO_ICALL                                         $15     
        35        CONCAT                                           ~16     $15, '%0A'
        36        ECHO                                                     ~16
  19    37        INIT_FCALL                                               'array_replace_recursive'
        38        FETCH_DIM_R                                      $17     !0, 0
        39        SEND_VAR                                                 $17
        40        FETCH_DIM_R                                      $18     !0, 1
        41        SEND_VAR                                                 $18
        42        DO_ICALL                                                 
  20    43        INIT_FCALL                                               'json_encode'
        44        SEND_VAR                                                 !0
        45        DO_ICALL                                         $20     
        46        ECHO                                                     $20
        47      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 11
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/RnPX8
function name:  func
number of ops:  13
compiled vars:  !0 = $data, !1 = $value, !2 = $key
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   RECV                                             !0      
   3     1      > FE_RESET_R                                       $3      !0, ->11
         2    > > FE_FETCH_R                                       ~4      $3, !1, ->11
         3    >   ASSIGN                                                   !2, ~4
   4     4        TYPE_CHECK                                    7  ~6      !1
         5      > JMPZ                                                     ~6, ->10
   5     6    >   INIT_FCALL_BY_NAME                                       'func'
         7        FETCH_DIM_FUNC_ARG                               $7      !0, !2
         8        SEND_VAR_EX                                              $7
         9        DO_FCALL                                      0          
        10    > > JMP                                                      ->2
        11    >   FE_FREE                                                  $3
   8    12      > RETURN                                                   null

End of function func

Generated using Vulcan Logic Dumper, using php 7.3.0