3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo\Bar\subnamespace; const FOO = 1; function foo() {} class foo { static function staticmethod() {} } namespace Foo\Bar; const FOO = 2; function foo() {} class foo { static function staticmethod() {} } /* Unqualified name */ foo(); // resolves to function Foo\Bar\foo foo::staticmethod(); // resolves to class Foo\Bar\foo, method staticmethod echo FOO,"<br />"; // resolves to constant Foo\Bar\FOO /* Qualified name */ subnamespace\foo(); // resolves to function Foo\Bar\subnamespace\foo subnamespace\foo::staticmethod(); // resolves to class Foo\Bar\subnamespace\foo, // method staticmethod echo subnamespace\FOO, "<br />"; // resolves to constant Foo\Bar\subnamespace\FOO /* Fully qualified name */ \Foo\Bar\foo(); // resolves to function Foo\Bar\foo \Foo\Bar\foo::staticmethod(); // resolves to class Foo\Bar\foo, method staticmethod echo \Foo\Bar\FOO; // resolves to constant Foo\Bar\FOO ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gGRHm
function name:  (null)
number of ops:  23
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CONST                                            'Foo%5CBar%5Csubnamespace%5CFOO', 1
   12     1        DECLARE_CONST                                            'Foo%5CBar%5CFOO', 2
   20     2        INIT_NS_FCALL_BY_NAME                                    'Foo%5CBar%5Cfoo'
          3        DO_FCALL                                      0          
   21     4        INIT_STATIC_METHOD_CALL                                  'Foo%5CBar%5Cfoo', 'staticmethod'
          5        DO_FCALL                                      0          
   22     6        FETCH_CONSTANT                                   ~2      'Foo%5CBar%5CFOO'
          7        ECHO                                                     ~2
          8        ECHO                                                     '%3Cbr+%2F%3E'
   25     9        INIT_FCALL                                               'foo%5Cbar%5Csubnamespace%5Cfoo'
         10        DO_FCALL                                      0          
   26    11        INIT_STATIC_METHOD_CALL                                  'Foo%5CBar%5Csubnamespace%5Cfoo', 'staticmethod'
         12        DO_FCALL                                      0          
   28    13        FETCH_CONSTANT                                   ~5      'Foo%5CBar%5Csubnamespace%5CFOO'
         14        ECHO                                                     ~5
         15        ECHO                                                     '%3Cbr+%2F%3E'
   31    16        INIT_FCALL                                               'foo%5Cbar%5Cfoo'
         17        DO_FCALL                                      0          
   32    18        INIT_STATIC_METHOD_CALL                                  'Foo%5CBar%5Cfoo', 'staticmethod'
         19        DO_FCALL                                      0          
   33    20        FETCH_CONSTANT                                   ~8      'Foo%5CBar%5CFOO'
         21        ECHO                                                     ~8
   34    22      > RETURN                                                   1

Function foo%5Cbar%5Csubnamespace%5Cfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gGRHm
function name:  Foo\Bar\subnamespace\foo
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function foo%5Cbar%5Csubnamespace%5Cfoo

Function foo%5Cbar%5Cfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gGRHm
function name:  Foo\Bar\foo
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   null

End of function foo%5Cbar%5Cfoo

Class Foo\Bar\subnamespace\foo:
Function staticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gGRHm
function name:  staticmethod
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   null

End of function staticmethod

End of class Foo\Bar\subnamespace\foo.

Class Foo\Bar\foo:
Function staticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gGRHm
function name:  staticmethod
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function staticmethod

End of class Foo\Bar\foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.91 ms | 1403 KiB | 16 Q