3v4l.org

run code in 500+ PHP versions simultaneously
<?php $_SESSION['var'] = 1; function func1() { global $ref; global $nonRef; $ref = &$_SESSION['var']; $nonRef = $_SESSION['var']; } func1(); var_dump($_SESSION['var']); var_dump($ref); var_dump($nonRef);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WGsD9
function name:  (null)
number of ops:  17
compiled vars:  !0 = $ref, !1 = $nonRef
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                          global              $2      '_SESSION'
          1        ASSIGN_DIM                                                   $2, 'var'
          2        OP_DATA                                                      1
   11     3        INIT_FCALL                                                   'func1'
          4        DO_FCALL                                          0          
   12     5        INIT_FCALL                                                   'var_dump'
          6        FETCH_R                          global              ~5      '_SESSION'
          7        FETCH_DIM_R                                          ~6      ~5, 'var'
          8        SEND_VAL                                                     ~6
          9        DO_ICALL                                                     
   13    10        INIT_FCALL                                                   'var_dump'
         11        SEND_VAR                                                     !0
         12        DO_ICALL                                                     
   14    13        INIT_FCALL                                                   'var_dump'
         14        SEND_VAR                                                     !1
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Function func1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WGsD9
function name:  func1
number of ops:  9
compiled vars:  !0 = $ref, !1 = $nonRef
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   BIND_GLOBAL                                                  !0, 'ref'
    7     1        BIND_GLOBAL                                                  !1, 'nonRef'
    8     2        FETCH_W                          global              $2      '_SESSION'
          3        FETCH_DIM_W                                          $3      $2, 'var'
          4        ASSIGN_REF                                                   !0, $3
    9     5        FETCH_R                          global              ~5      '_SESSION'
          6        FETCH_DIM_R                                          ~6      ~5, 'var'
          7        ASSIGN                                                       !1, ~6
   10     8      > RETURN                                                       null

End of function func1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
221.35 ms | 2651 KiB | 10 Q