3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Testing Globals $GLOBALS['A'] = 'B'; $arrayCopyGlobalsVar = $GLOBALS; $arrayCopyGlobalsVar['A'] = 'C'; var_dump([ '$GLOBALS' => $GLOBALS['A'], '$arrayCopyGlobalsVar' => $arrayCopyGlobalsVar['A'], ]); $GLOBALS['A'] = 'B'; $nonReferencedGlobalsVar = new ArrayObject($GLOBALS); $nonReferencedGlobalsVar = $nonReferencedGlobalsVar->getArrayCopy(); $nonReferencedGlobalsVar['A'] = 'D'; var_dump([ '$GLOBALS' => $GLOBALS['A'], '$nonReferencedGlobalsVar' => $nonReferencedGlobalsVar['A'] ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VkDgZ
function name:  (null)
number of ops:  33
compiled vars:  !0 = $arrayCopyGlobalsVar, !1 = $nonReferencedGlobalsVar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_W                      global              $2      'A'
          1        ASSIGN                                                   $2, 'B'
    6     2        FETCH_GLOBALS                                    ~4      
          3        ASSIGN                                                   !0, ~4
    7     4        ASSIGN_DIM                                               !0, 'A'
          5        OP_DATA                                                  'C'
    9     6        INIT_FCALL                                               'var_dump'
   10     7        FETCH_R                      global              ~7      'A'
          8        INIT_ARRAY                                       ~8      ~7, '%24GLOBALS'
   11     9        FETCH_DIM_R                                      ~9      !0, 'A'
         10        ADD_ARRAY_ELEMENT                                ~8      ~9, '%24arrayCopyGlobalsVar'
         11        SEND_VAL                                                 ~8
    9    12        DO_ICALL                                                 
   14    13        FETCH_W                      global              $11     'A'
         14        ASSIGN                                                   $11, 'B'
   16    15        NEW                                              $13     'ArrayObject'
         16        FETCH_GLOBALS                                    ~14     
         17        SEND_VAL_EX                                              ~14
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !1, $13
   17    20        INIT_METHOD_CALL                                         !1, 'getArrayCopy'
         21        DO_FCALL                                      0  $17     
         22        ASSIGN                                                   !1, $17
   18    23        ASSIGN_DIM                                               !1, 'A'
         24        OP_DATA                                                  'D'
   20    25        INIT_FCALL                                               'var_dump'
   21    26        FETCH_R                      global              ~20     'A'
         27        INIT_ARRAY                                       ~21     ~20, '%24GLOBALS'
   22    28        FETCH_DIM_R                                      ~22     !1, 'A'
         29        ADD_ARRAY_ELEMENT                                ~21     ~22, '%24nonReferencedGlobalsVar'
         30        SEND_VAL                                                 ~21
   20    31        DO_ICALL                                                 
   23    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.11 ms | 1437 KiB | 14 Q