3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace NAME_SPACE; trait Bar { public static function qux() { var_dump(self::class, static::class); return new \ReflectionMethod(static::class, __FUNCTION__); } } class Foo { use Bar; } var_dump(Foo::qux()->getName()); Bar::qux();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O15jg
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   DECLARE_CLASS                                            'name_space%5Cfoo'
   19     1        INIT_NS_FCALL_BY_NAME                                    'NAME_SPACE%5Cvar_dump'
          2        INIT_STATIC_METHOD_CALL                                  'NAME_SPACE%5CFoo', 'qux'
          3        DO_FCALL                                      0  $0      
          4        INIT_METHOD_CALL                                         $0, 'getName'
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR_NO_REF_EX                                       $1
          7        DO_FCALL                                      0          
   20     8        INIT_STATIC_METHOD_CALL                                  'NAME_SPACE%5CBar', 'qux'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class NAME_SPACE\Bar:
Function qux:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O15jg
function name:  qux
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_NS_FCALL_BY_NAME                                    'NAME_SPACE%5Cvar_dump'
          1        FETCH_CLASS_NAME                                 ~0      
          2        SEND_VAL_EX                                              ~0
          3        FETCH_CLASS_NAME                                 ~1      
          4        SEND_VAL_EX                                              ~1
          5        DO_FCALL                                      0          
   10     6        NEW                                              $3      'ReflectionMethod'
          7        FETCH_CLASS_NAME                                 ~4      
          8        SEND_VAL_EX                                              ~4
          9        SEND_VAL_EX                                              'qux'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   $3
   11    12*     > RETURN                                                   null

End of function qux

End of class NAME_SPACE\Bar.

Class NAME_SPACE\Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1395 KiB | 15 Q