3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface X { public function a(); } class A implements X { public function a() {} } class B extends A { } $r = new ReflectionClass("B"); foreach($r->getMethods() as $method) { echo $method->getName()."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/OQFXo
function name:  (null)
number of ops:  17
compiled vars:  !0 = $r, !1 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'a'
    8     1        DECLARE_CLASS                                            'b', 'a'
    9     2        NEW                                              $2      'ReflectionClass'
          3        SEND_VAL_EX                                              'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   10     6        INIT_METHOD_CALL                                         !0, 'getMethods'
          7        DO_FCALL                                      0  $5      
          8      > FE_RESET_R                                       $6      $5, ->15
          9    > > FE_FETCH_R                                               $6, !1, ->15
         10    >   INIT_METHOD_CALL                                         !1, 'getName'
         11        DO_FCALL                                      0  $7      
         12        CONCAT                                           ~8      $7, '%0A'
         13        ECHO                                                     ~8
         14      > JMP                                                      ->9
         15    >   FE_FREE                                                  $6
         16      > RETURN                                                   1

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

End of function a

End of class X.

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

End of function a

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.09 ms | 1395 KiB | 13 Q