3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B extends A { const A = 'a'; } abstract class A { public static function get() { self::resolve(); } private static function resolve() { $r = new ReflectionClass(get_called_class()); var_dump($r->getConstants()); } } A::get();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WlYce
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'b', 'a'
   22     1        INIT_STATIC_METHOD_CALL                                  'A', 'get'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Class B: [no user functions]
Class A:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WlYce
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_STATIC_METHOD_CALL                                  'resolve'
          1        DO_FCALL                                      0          
   13     2      > RETURN                                                   null

End of function get

Function resolve:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WlYce
function name:  resolve
number of ops:  11
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'ReflectionClass'
          1        GET_CALLED_CLASS                                 ~2      
          2        SEND_VAL_EX                                              ~2
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   18     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getConstants'
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
   19    10      > RETURN                                                   null

End of function resolve

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.62 ms | 1395 KiB | 15 Q