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 \ReflectionFunction(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/YPFJM
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

Function %00name_space%5C%7Bclosure%7D%2Fin%2FYPFJM%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YPFJM
function name:  NAME_SPACE\{closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function %00name_space%5C%7Bclosure%7D%2Fin%2FYPFJM%3A10%240

Class NAME_SPACE\Bar:
Function qux:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YPFJM
function name:  qux
number of ops:  12
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      'ReflectionFunction'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00name_space%5C%7Bclosure%7D%2Fin%2FYPFJM%3A10%240'
          8        SEND_VAL_EX                                              ~4
          9        DO_FCALL                                      0          
         10      > RETURN                                                   $3
   11    11*     > 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:
154.44 ms | 1388 KiB | 15 Q