3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class A { public function __get($key) { var_dump(__METHOD__, $key); } } class B extends A { public function __get($key) { var_dump(__METHOD__, $key); } } $b = new B(); $b->test; (new ReflectionObject($b)) ->getParentClass() ->getMethod('__get') ->getClosure($b)('test');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0tj26
function name:  (null)
number of ops:  20
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   NEW                                                  $1      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   16     3        FETCH_OBJ_R                                          ~4      !0, 'test'
          4        FREE                                                         ~4
   18     5        NEW                                                  $5      'ReflectionObject'
          6        SEND_VAR_EX                                                  !0
          7        DO_FCALL                                          0          
   19     8        INIT_METHOD_CALL                                             $5, 'getParentClass'
          9        DO_FCALL                                          0  $7      
   20    10        INIT_METHOD_CALL                                             $7, 'getMethod'
         11        SEND_VAL_EX                                                  '__get'
         12        DO_FCALL                                          0  $8      
   21    13        INIT_METHOD_CALL                                             $8, 'getClosure'
         14        SEND_VAR_EX                                                  !0
         15        DO_FCALL                                          0  $9      
         16        INIT_DYNAMIC_CALL                                            $9
         17        SEND_VAL_EX                                                  'test'
         18        DO_FCALL                                          0          
         19      > RETURN                                                       1

Class A:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0tj26
function name:  __get
number of ops:  6
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAL                                                     'A%3A%3A__get'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                                     
    6     5      > 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/0tj26
function name:  __get
number of ops:  6
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAL                                                     'B%3A%3A__get'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                                     
   12     5      > RETURN                                                       null

End of function __get

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
218.36 ms | 2009 KiB | 14 Q