3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Ref; trait T { public $traitProperty; public function traitMethod() {} } interface I { const I = 'I'; public function i(); } abstract class A implements I { use T { T::traitMethod as tMethod; } const A = 'A'; public function __construct() {} public function a() {} } abstract class B extends A { const B = 'B'; public $public = 'public'; protected static $publicStatic; } class C extends B { public function __construct(\ReflectionClass $a) { } public function i() {} } $r = new \ReflectionClass('Ref\C'); //$r->getProperty('publicStatic')->setAccessible(true); var_dump($r->hasMethod('tMethod')); var_dump($r->hasMethod('traitMethod')); var_dump($r->hasMethod('a')); var_dump($r->isSubclassOf('Ref\I')); $r->newInstance();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2pmPY
function name:  (null)
number of ops:  34
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                            'ref%5Ca'
   32     1        DECLARE_CLASS                                            'ref%5Cb', 'ref%5Ca'
   41     2        DECLARE_CLASS                                            'ref%5Cc', 'ref%5Cb'
   50     3        NEW                                              $1      'ReflectionClass'
          4        SEND_VAL_EX                                              'Ref%5CC'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
   52     7        INIT_NS_FCALL_BY_NAME                                    'Ref%5Cvar_dump'
          8        INIT_METHOD_CALL                                         !0, 'hasMethod'
          9        SEND_VAL_EX                                              'tMethod'
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR_NO_REF_EX                                       $4
         12        DO_FCALL                                      0          
   53    13        INIT_NS_FCALL_BY_NAME                                    'Ref%5Cvar_dump'
         14        INIT_METHOD_CALL                                         !0, 'hasMethod'
         15        SEND_VAL_EX                                              'traitMethod'
         16        DO_FCALL                                      0  $6      
         17        SEND_VAR_NO_REF_EX                                       $6
         18        DO_FCALL                                      0          
   54    19        INIT_NS_FCALL_BY_NAME                                    'Ref%5Cvar_dump'
         20        INIT_METHOD_CALL                                         !0, 'hasMethod'
         21        SEND_VAL_EX                                              'a'
         22        DO_FCALL                                      0  $8      
         23        SEND_VAR_NO_REF_EX                                       $8
         24        DO_FCALL                                      0          
   55    25        INIT_NS_FCALL_BY_NAME                                    'Ref%5Cvar_dump'
         26        INIT_METHOD_CALL                                         !0, 'isSubclassOf'
         27        SEND_VAL_EX                                              'Ref%5CI'
         28        DO_FCALL                                      0  $10     
         29        SEND_VAR_NO_REF_EX                                       $10
         30        DO_FCALL                                      0          
   57    31        INIT_METHOD_CALL                                         !0, 'newInstance'
         32        DO_FCALL                                      0          
         33      > 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/2pmPY
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:
Function i:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2pmPY
function name:  i
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function i

End of class Ref\I.

Class Ref\A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2pmPY
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     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/2pmPY
function name:  a
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E > > RETURN                                                   null

End of function a

End of class Ref\A.

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

End of function __construct

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

End of function i

End of class Ref\C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.63 ms | 1400 KiB | 15 Q