3v4l.org

run code in 300+ PHP versions simultaneously
<?php function & change(&$keys,&$value, $c) { if ($k = next($keys)) { return change($keys,$value[$k], $c); } else { return $value = $c; } } $keys = ['k1','k2','k3','k4']; $hub = []; change($keys,$hub,1); var_dump($hub);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g63tm
function name:  (null)
number of ops:  11
compiled vars:  !0 = $keys, !1 = $hub
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   14     2        INIT_FCALL                                               'change'
          3        SEND_REF                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 1
          6        DO_FCALL                                      0          
   16     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function change:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
Return found
Branch analysis from position: 17
Return found
filename:       /in/g63tm
function name:  change
number of ops:  20
compiled vars:  !0 = $keys, !1 = $value, !2 = $c, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        INIT_FCALL                                               'next'
          4        SEND_REF                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                           ~5      !3, $4
          7      > JMPZ                                                     ~5, ->17
    5     8    >   INIT_FCALL_BY_NAME                                       'change'
          9        SEND_VAR_EX                                              !0
         10        CHECK_FUNC_ARG                                           
         11        FETCH_DIM_FUNC_ARG                               $6      !1, !3
         12        SEND_FUNC_ARG                                            $6
         13        SEND_VAR_EX                                              !2
         14        DO_FCALL                                      0  $7      
         15      > RETURN_BY_REF                                            $7
         16*       JMP                                                      ->19
    7    17    >   ASSIGN                                           ~8      !1, !2
         18      > RETURN_BY_REF                                            ~8
   10    19*     > RETURN_BY_REF                                            null

End of function change

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.69 ms | 1399 KiB | 18 Q