3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { public function __get($a) { echo 1; } } class B { use A { __get as protected __previousGet; } public function __get($a) { $this->__previousGet($a); } } $b = new B(); $b->hello;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cooq0
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'b'
   15     1        NEW                                              $1      'B'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   16     4        FETCH_OBJ_R                                      ~4      !0, 'hello'
          5        FREE                                                     ~4
          6      > RETURN                                                   1

Class A:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cooq0
function name:  __get
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        ECHO                                                     1
          2      > RETURN                                                   null

End of function __get

End of class A.

Class B:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cooq0
function name:  __get
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_METHOD_CALL                                         '__previousGet'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   12     4      > RETURN                                                   null

End of function __get

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.1 ms | 1398 KiB | 13 Q