3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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/YMeMW
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'foo'
   17     1        INIT_FCALL                                               'var_dump'
          2        INIT_STATIC_METHOD_CALL                                  'Foo', 'qux'
          3        DO_FCALL                                      0  $0      
          4        INIT_METHOD_CALL                                         $0, 'getName'
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
   18     8        INIT_STATIC_METHOD_CALL                                  'Bar', 'qux'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class Bar:
Function qux:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YMeMW
function name:  qux
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_NAME                                 ~0      
          2        SEND_VAL                                                 ~0
          3        FETCH_CLASS_NAME                                 ~1      
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
    8     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
    9    12*     > RETURN                                                   null

End of function qux

End of class Bar.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.47 ms | 1395 KiB | 15 Q