3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B extends A { const A = 'a'; } class C extends B { const B = 'b'; } abstract class A { private static $constants = array(); public static function get() { self::resolve(); } private static function resolve() { $r = new ReflectionClass(get_called_class()); var_dump($r->getConstants()); } } $arr = array(false); var_dump(in_array(false, $arr, true));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MKncn
function name:  (null)
number of ops:  12
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'b', 'a'
    8     1        DECLARE_CLASS                                            'c', 'b'
   29     2        ASSIGN                                                   !0, <array>
   31     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'in_array'
          5        SEND_VAL                                                 <false>
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class B: [no user functions]
Class C: [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/MKncn
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'resolve'
          1        DO_FCALL                                      0          
   20     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/MKncn
function name:  resolve
number of ops:  11
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'ReflectionClass'
          1        GET_CALLED_CLASS                                 ~2      
          2        SEND_VAL_EX                                              ~2
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   25     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getConstants'
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
   26    10      > RETURN                                                   null

End of function resolve

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.42 ms | 1396 KiB | 17 Q