3v4l.org

run code in 300+ PHP versions simultaneously
<?php $params = [1,2,3]; function transform(array $params) { $references = []; foreach ($params as $key => $value) { $references[$key] = &$params[$key]; } unset($value); $value = "foo"; return $references; return $references; } var_dump($params); $params = transform($params); var_dump($params); $hovno = 'prdel'; $prdel = &$hovno; var_dum($hovno); var_dump($prdel);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lr9fS
function name:  (null)
number of ops:  20
compiled vars:  !0 = $params, !1 = $hovno, !2 = $prdel
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   19     4        INIT_FCALL                                               'transform'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !0, $5
   20     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   22    11        ASSIGN                                                   !1, 'prdel'
   23    12        ASSIGN_REF                                               !2, !1
   25    13        INIT_FCALL_BY_NAME                                       'var_dum'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
   26    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function transform:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/Lr9fS
function name:  transform
number of ops:  16
compiled vars:  !0 = $params, !1 = $references, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, <array>
    8     2      > FE_RESET_R                                       $5      !0, ->10
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->10
          4    >   ASSIGN                                                   !3, ~6
    9     5        FETCH_DIM_W                                      $9      !0, !3
          6        MAKE_REF                                         $10     $9
          7        FETCH_DIM_W                                      $8      !1, !3
          8        ASSIGN_REF                                               $8, $10
    8     9      > JMP                                                      ->3
         10    >   FE_FREE                                                  $5
   11    11        UNSET_CV                                                 !2
   12    12        ASSIGN                                                   !2, 'foo'
   13    13      > RETURN                                                   !1
   15    14*       RETURN                                                   !1
   16    15*     > RETURN                                                   null

End of function transform

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.55 ms | 1403 KiB | 16 Q