3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static $elements = []; public function getElements() { return self::$elements; } } // let's create an instance of A $a = new A; $a::$elements['first_key'] = 'defined'; A::$elements['direct_instance_key'] = 'defined_too'; var_dump($a->getElements(), A::$elements); $b = new A; var_dump($b->getElements());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g7LXc
function name:  (null)
number of ops:  26
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        FETCH_CLASS                                   0  $5      !0
          4        FETCH_STATIC_PROP_W          unknown             $6      'elements'
          5        ASSIGN_DIM                                               $6, 'first_key'
          6        OP_DATA                                                  'defined'
   15     7        FETCH_STATIC_PROP_W          unknown             $8      'elements'
          8        ASSIGN_DIM                                               $8, 'direct_instance_key'
          9        OP_DATA                                                  'defined_too'
   17    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !0, 'getElements'
         12        DO_FCALL                                      0  $10     
         13        SEND_VAR                                                 $10
         14        FETCH_STATIC_PROP_R          unknown             ~11     'elements'
         15        SEND_VAL                                                 ~11
         16        DO_ICALL                                                 
   19    17        NEW                                              $13     'A'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !1, $13
   20    20        INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !1, 'getElements'
         22        DO_FCALL                                      0  $16     
         23        SEND_VAR                                                 $16
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Class A:
Function getelements:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g7LXc
function name:  getElements
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'elements'
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function getelements

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.43 ms | 1396 KiB | 15 Q