3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace Foo; class Bar { public static function testClass(): \Closure { return function(){}; } } function testFunc(): \Closure { return function(){}; } var_dump((new \ReflectionFunction(Bar::testClass()))->getNamespaceName()); var_dump((new \ReflectionFunction(testFunc()))->getNamespaceName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjjJK
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   INIT_NS_FCALL_BY_NAME                                        'Foo%5Cvar_dump'
          1        NEW                                                  $0      'ReflectionFunction'
          2        INIT_STATIC_METHOD_CALL                                      'Foo%5CBar', 'testClass'
          3        DO_FCALL                                          0  $1      
          4        SEND_VAR_NO_REF_EX                                           $1
          5        DO_FCALL                                          0          
          6        INIT_METHOD_CALL                                             $0, 'getNamespaceName'
          7        DO_FCALL                                          0  $3      
          8        SEND_VAR_NO_REF_EX                                           $3
          9        DO_FCALL                                          0          
   19    10        INIT_NS_FCALL_BY_NAME                                        'Foo%5Cvar_dump'
         11        NEW                                                  $5      'ReflectionFunction'
         12        INIT_NS_FCALL_BY_NAME                                        'Foo%5CtestFunc'
         13        DO_FCALL                                          0  $6      
         14        SEND_VAR_NO_REF_EX                                           $6
         15        DO_FCALL                                          0          
         16        INIT_METHOD_CALL                                             $5, 'getNamespaceName'
         17        DO_FCALL                                          0  $8      
         18        SEND_VAR_NO_REF_EX                                           $8
         19        DO_FCALL                                          0          
         20      > RETURN                                                       1

Function foo%5Ctestfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjjJK
function name:  Foo\testFunc
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   DECLARE_LAMBDA_FUNCTION                              ~0      [0]
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   16     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjjJK
function name:  {closure:Foo\testFunc():15}
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                       null

End of Dynamic Function 0

End of function foo%5Ctestfunc

Class Foo\Bar:
Function testclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjjJK
function name:  testClass
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   DECLARE_LAMBDA_FUNCTION                              ~0      [0]
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   10     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjjJK
function name:  {closure:Foo\Bar::testClass():9}
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                       null

End of Dynamic Function 0

End of function testclass

End of class Foo\Bar.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.37 ms | 1589 KiB | 15 Q