3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClassWithMagicConstants { const A = __DIR__; const B = __FILE__; const C = __NAMESPACE__; const D = __CLASS__; const E = __LINE__; public static $a = self::A; protected static $b = self::B; private static $c = self::C; } const NS_CONST = 'test'; class ClassWithConstantsAndInheritance extends ClassWithMagicConstants { const A = 'overridden'; const H = M_PI; const J = NS_CONST; public static $h = self::H; } $refClass = new ReflectionClass('ClassWithConstantsAndInheritance'); var_dump($refClass->getStaticProperties());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aDdQ6
function name:  (null)
number of ops:  11
compiled vars:  !0 = $refClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   DECLARE_CONST                                            'NS_CONST', 'test'
   27     1        NEW                                              $1      'ReflectionClass'
          2        SEND_VAL_EX                                              'ClassWithConstantsAndInheritance'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   28     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getStaticProperties'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class ClassWithMagicConstants: [no user functions]
Class ClassWithConstantsAndInheritance: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.16 ms | 1394 KiB | 15 Q