3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = new stdClass; $x->a = 1; $_SESSION['x'] = $x; function smth() { $x = $_SESSION['x']; return $x; } print_r($x); $y = smth(); $y->y = 'A'; print_R($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sCLNb
function name:  (null)
number of ops:  20
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  1
    5     5        FETCH_W                      global              $6      '_SESSION'
          6        ASSIGN_DIM                                               $6, 'x'
          7        OP_DATA                                                  !0
   13     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   15    11        INIT_FCALL                                               'smth'
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !1, $9
   16    14        ASSIGN_OBJ                                               !1, 'y'
         15        OP_DATA                                                  'A'
   18    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function smth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sCLNb
function name:  smth
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_R                      global              ~1      '_SESSION'
          1        FETCH_DIM_R                                      ~2      ~1, 'x'
          2        ASSIGN                                                   !0, ~2
   10     3      > RETURN                                                   !0
   11     4*     > RETURN                                                   null

End of function smth

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.95 ms | 1398 KiB | 16 Q