3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $p1 = "secret"; public function B() { var_dump($this); ${'t' . 'his'} = 'hidden'; // works var_dump($this); echo $this . ' ' . $this->p1; var_dump($GLOBALS['this']); // class is global but $this is not since only refers to this particular object. $GLOBALS['this'] = 'lovely'; var_dump($this, $GLOBALS['this']); echo $this . ' ' . $this->p1; } } $a = new A; $a->B();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCpBt
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'B'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class A:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCpBt
function name:  B
number of ops:  36
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    6     4        FETCH_W                      local               $2      'this'
          5        ASSIGN                                                   $2, 'hidden'
    7     6        INIT_FCALL                                               'var_dump'
          7        FETCH_THIS                                       ~4      
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
    8    10        FETCH_THIS                                       ~6      
         11        CONCAT                                           ~7      ~6, '+'
         12        FETCH_OBJ_R                                      ~8      'p1'
         13        CONCAT                                           ~9      ~7, ~8
         14        ECHO                                                     ~9
    9    15        INIT_FCALL                                               'var_dump'
         16        FETCH_R                      global              ~10     'GLOBALS'
         17        FETCH_DIM_R                                      ~11     ~10, 'this'
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                                 
   10    20        FETCH_W                      global              $13     'GLOBALS'
         21        ASSIGN_DIM                                               $13, 'this'
         22        OP_DATA                                                  'lovely'
   11    23        INIT_FCALL                                               'var_dump'
         24        FETCH_THIS                                       ~15     
         25        SEND_VAL                                                 ~15
         26        FETCH_R                      global              ~16     'GLOBALS'
         27        FETCH_DIM_R                                      ~17     ~16, 'this'
         28        SEND_VAL                                                 ~17
         29        DO_ICALL                                                 
   12    30        FETCH_THIS                                       ~19     
         31        CONCAT                                           ~20     ~19, '+'
         32        FETCH_OBJ_R                                      ~21     'p1'
         33        CONCAT                                           ~22     ~20, ~21
         34        ECHO                                                     ~22
   14    35      > RETURN                                                   null

End of function b

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.14 ms | 1400 KiB | 15 Q