3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func(&$data) { foreach ($data as $key => $value) { if (is_array($value)) { func($data[$key]); } } } $data = [ ['zero' => [0]], ['one' => [1]], ]; debug_zval_dump($data[1]['one']); //refcount=2 for ($i = 0; $i < 10000; $i++) func($data); debug_zval_dump($data[1]['one']); //refcount=3
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 8
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 8
Branch analysis from position: 14
Branch analysis from position: 8
filename:       /in/YRojj
function name:  (null)
number of ops:  20
compiled vars:  !0 = $data, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'debug_zval_dump'
          2        FETCH_DIM_R                                      ~3      !0, 1
          3        FETCH_DIM_R                                      ~4      ~3, 'one'
          4        SEND_VAL                                                 ~4
          5        DO_ICALL                                                 
   16     6        ASSIGN                                                   !1, 0
          7      > JMP                                                      ->12
          8    >   INIT_FCALL                                               'func'
          9        SEND_REF                                                 !0
         10        DO_FCALL                                      0          
         11        PRE_INC                                                  !1
         12    >   IS_SMALLER                                               !1, 10000
         13      > JMPNZ                                                    ~9, ->8
   17    14    >   INIT_FCALL                                               'debug_zval_dump'
         15        FETCH_DIM_R                                      ~10     !0, 1
         16        FETCH_DIM_R                                      ~11     ~10, 'one'
         17        SEND_VAL                                                 ~11
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

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

End of function func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.43 ms | 1403 KiB | 16 Q