3v4l.org

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

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KX2Ku
function name:  foo
number of ops:  5
compiled vars:  !0 = $boo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_W                      global              $1      '_SESSION'
          2        FETCH_DIM_W                                      $2      $1, 'boo'
          3        ASSIGN_REF                                               $2, !0
    5     4      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.7 ms | 1397 KiB | 18 Q