3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Ref; trait T { public $traitProperty; public function traitMethod() {} } interface I { const I = 'I'; } class A implements I { use T { T::traitMethod as tMethod; } const A = 'A'; public function __construct() {} public function a() {} } class B extends A { const B = 'B'; public $public = 'public'; protected static $publicStatic; } $r = new \ReflectionClass('Ref\B'); //$r->getProperty('publicStatic')->setAccessible(true); var_dump($r->hasMethod('tMethod')); var_dump($r->hasMethod('traitMethod')); var_dump($r->hasMethod('a'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t8HHY
function name:  (null)
number of ops:  25
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   DECLARE_CLASS                                            'ref%5Ca'
   30     1        DECLARE_CLASS                                            'ref%5Cb', 'ref%5Ca'
   39     2        NEW                                              $1      'ReflectionClass'
          3        SEND_VAL_EX                                              'Ref%5CB'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   41     6        INIT_NS_FCALL_BY_NAME                                    'Ref%5Cvar_dump'
          7        INIT_METHOD_CALL                                         !0, 'hasMethod'
          8        SEND_VAL_EX                                              'tMethod'
          9        DO_FCALL                                      0  $4      
         10        SEND_VAR_NO_REF_EX                                       $4
         11        DO_FCALL                                      0          
   42    12        INIT_NS_FCALL_BY_NAME                                    'Ref%5Cvar_dump'
         13        INIT_METHOD_CALL                                         !0, 'hasMethod'
         14        SEND_VAL_EX                                              'traitMethod'
         15        DO_FCALL                                      0  $6      
         16        SEND_VAR_NO_REF_EX                                       $6
         17        DO_FCALL                                      0          
   43    18        INIT_NS_FCALL_BY_NAME                                    'Ref%5Cvar_dump'
         19        INIT_METHOD_CALL                                         !0, 'hasMethod'
         20        SEND_VAL_EX                                              'a'
         21        DO_FCALL                                      0  $8      
         22        SEND_VAR_NO_REF_EX                                       $8
         23        DO_FCALL                                      0          
         24      > RETURN                                                   1

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

End of function traitmethod

End of class Ref\T.

Class Ref\I: [no user functions]
Class Ref\A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t8HHY
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E > > RETURN                                                   null

End of function __construct

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

End of function a

End of class Ref\A.

Class Ref\B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.14 ms | 1396 KiB | 15 Q