3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function privateMethod() {} } class C extends A { private function privateMethod() {} private function otherMethod() {} } $class = new ReflectionClass('C'); echo (string)$class->getMethod('privateMethod'); echo (string)$class->getMethod('otherMethod');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dm3Y9
function name:  (null)
number of ops:  15
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'C'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   12     4        INIT_METHOD_CALL                                         !0, 'getMethod'
          5        SEND_VAL_EX                                              'privateMethod'
          6        DO_FCALL                                      0  $4      
          7        CAST                                          6  ~5      $4
          8        ECHO                                                     ~5
   13     9        INIT_METHOD_CALL                                         !0, 'getMethod'
         10        SEND_VAL_EX                                              'otherMethod'
         11        DO_FCALL                                      0  $6      
         12        CAST                                          6  ~7      $6
         13        ECHO                                                     ~7
         14      > RETURN                                                   1

Class A:
Function privatemethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dm3Y9
function name:  privateMethod
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   null

End of function privatemethod

End of class A.

Class C:
Function privatemethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dm3Y9
function name:  privateMethod
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function privatemethod

Function othermethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dm3Y9
function name:  otherMethod
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   null

End of function othermethod

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.48 ms | 1008 KiB | 13 Q