3v4l.org

run code in 500+ PHP versions simultaneously
<?php $cart = (object) array('cart' => NULL); if (!isset($_SESSION['tmgmt_cart'])) { $_SESSION['tmgmt_cart'] = array(); } $cart->cart =& $_SESSION['tmgmt_cart']; $cart->cart['ok'] = 'ok'; print_r($cart->cart); print_r($_SESSION['tmgmt_cart']); $cart->cart = array(); print_r($cart->cart); print_r($_SESSION['tmgmt_cart']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/rQ8jE
function name:  (null)
number of ops:  38
compiled vars:  !0 = $cart
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   CAST                                              8  ~1      <array>
          1        ASSIGN                                                       !0, ~1
    4     2        FETCH_IS                                             ~3      '_SESSION'
          3        ISSET_ISEMPTY_DIM_OBJ                             0  ~4      ~3, 'tmgmt_cart'
          4        BOOL_NOT                                             ~5      ~4
          5      > JMPZ                                                         ~5, ->9
    5     6    >   FETCH_W                          global              $6      '_SESSION'
          7        ASSIGN_DIM                                                   $6, 'tmgmt_cart'
          8        OP_DATA                                                      <array>
    7     9    >   FETCH_W                          global              $9      '_SESSION'
         10        FETCH_DIM_W                                          $10     $9, 'tmgmt_cart'
         11        MAKE_REF                                             $11     $10
         12        ASSIGN_OBJ_REF                                               !0, 'cart'
         13        OP_DATA                                                      $11
    8    14        FETCH_OBJ_W                                          $12     !0, 'cart'
         15        ASSIGN_DIM                                                   $12, 'ok'
         16        OP_DATA                                                      'ok'
    9    17        INIT_FCALL                                                   'print_r'
         18        FETCH_OBJ_R                                          ~14     !0, 'cart'
         19        SEND_VAL                                                     ~14
         20        DO_ICALL                                                     
   10    21        INIT_FCALL                                                   'print_r'
         22        FETCH_R                          global              ~16     '_SESSION'
         23        FETCH_DIM_R                                          ~17     ~16, 'tmgmt_cart'
         24        SEND_VAL                                                     ~17
         25        DO_ICALL                                                     
   11    26        ASSIGN_OBJ                                                   !0, 'cart'
         27        OP_DATA                                                      <array>
   12    28        INIT_FCALL                                                   'print_r'
         29        FETCH_OBJ_R                                          ~20     !0, 'cart'
         30        SEND_VAL                                                     ~20
         31        DO_ICALL                                                     
   13    32        INIT_FCALL                                                   'print_r'
         33        FETCH_R                          global              ~22     '_SESSION'
         34        FETCH_DIM_R                                          ~23     ~22, 'tmgmt_cart'
         35        SEND_VAL                                                     ~23
         36        DO_ICALL                                                     
         37      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
125.75 ms | 478 KiB | 8 Q