3v4l.org

run code in 300+ PHP versions simultaneously
<?php function shortenedRecursiveExport(&$data, $depth = 0) { foreach ($data as $key => $value) { if (is_array($value)) { shortenedRecursiveExport($data[$key], $depth + 1); } } } $data = [ ['k' => [0, 1]], ['k' => [2, 3]], ]; echo 'pre: ' . json_encode($data) . "\n"; shortenedRecursiveExport($data); array_replace_recursive($data[0], $data[1]); echo 'post: ' . json_encode($data) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ekaSW
function name:  (null)
number of ops:  23
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        CONCAT                                           ~3      'pre%3A++', $2
          5        CONCAT                                           ~4      ~3, '%0A'
          6        ECHO                                                     ~4
   16     7        INIT_FCALL                                               'shortenedrecursiveexport'
          8        SEND_REF                                                 !0
          9        DO_FCALL                                      0          
   17    10        INIT_FCALL                                               'array_replace_recursive'
         11        FETCH_DIM_R                                      ~6      !0, 0
         12        SEND_VAL                                                 ~6
         13        FETCH_DIM_R                                      ~7      !0, 1
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                                 
   18    16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $9      
         19        CONCAT                                           ~10     'post%3A+', $9
         20        CONCAT                                           ~11     ~10, '%0A'
         21        ECHO                                                     ~11
         22      > RETURN                                                   1

Function shortenedrecursiveexport:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
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 = 3
Branch analysis from position: 3
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ekaSW
function name:  shortenedRecursiveExport
number of ops:  17
compiled vars:  !0 = $data, !1 = $depth, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      0
    4     2      > FE_RESET_R                                       $4      !0, ->15
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->15
          4    >   ASSIGN                                                   !3, ~5
    5     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~7, ->14
    6     7    >   INIT_FCALL_BY_NAME                                       'shortenedRecursiveExport'
          8        CHECK_FUNC_ARG                                           
          9        FETCH_DIM_FUNC_ARG                               $8      !0, !3
         10        SEND_FUNC_ARG                                            $8
         11        ADD                                              ~9      !1, 1
         12        SEND_VAL_EX                                              ~9
         13        DO_FCALL                                      0          
    4    14    > > JMP                                                      ->3
         15    >   FE_FREE                                                  $4
    9    16      > RETURN                                                   null

End of function shortenedrecursiveexport

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.41 ms | 1394 KiB | 18 Q