3v4l.org

run code in 300+ PHP versions simultaneously
<?php const A = [1, 2, 3]; class B { const A = A; } $r = new ReflectionClass('B'); $A = $r->getConstant('A'); var_dump($A); $A[3] = 4; var_dump(A, $A);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0hH2
function name:  (null)
number of ops:  20
compiled vars:  !0 = $r, !1 = $A
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'A', <array>
    9     1        NEW                                              $2      'ReflectionClass'
          2        SEND_VAL_EX                                              'B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   11     5        INIT_METHOD_CALL                                         !0, 'getConstant'
          6        SEND_VAL_EX                                              'A'
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !1, $5
   12     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   13    12        ASSIGN_DIM                                               !1, 3
         13        OP_DATA                                                  4
   15    14        INIT_FCALL                                               'var_dump'
         15        FETCH_CONSTANT                                   ~9      'A'
         16        SEND_VAL                                                 ~9
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.69 ms | 1395 KiB | 15 Q