3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A; use B\D, C\E as F; // function calls function foo() { echo __NAMESPACE__;} // function calls foo(); // first tries to call "foo" defined in namespace "A" // then calls global function "foo" new D(); // using import rules, creates object of class "D" defined in namespace "B" // if not found, it tries to autoload class "B\D" new F(); // using import rules, creates object of class "E" defined in namespace "C" // if not found, it tries to autoload class "C\E" new \B(); // creates object of class "B" defined in global scope // if not found, it tries to autoload class "B" new \D(); // creates object of class "D" defined in global scope // if not found, it tries to autoload class "D" new \F(); // creates object of class "F" defined in global scope // if not found, it tries to autoload class "F" // static methods/namespace functions from another namespace B\foo(); // calls function "foo" from namespace "A\B" B::foo(); // calls method "foo" of class "B" defined in namespace "A" // if class "A\B" not found, it tries to autoload class "A\B" D::foo(); // using import rules, calls method "foo" of class "D" defined in namespace "B" // if class "B\D" not found, it tries to autoload class "B\D" \B\foo(); // calls function "foo" from namespace "B" \B::foo(); // calls method "foo" of class "B" from global scope // if class "B" not found, it tries to autoload class "B" // static methods/namespace functions of current namespace A\B::foo(); // calls method "foo" of class "B" from namespace "A\A" // if class "A\A\B" not found, it tries to autoload class "A\A\B" \A\B::foo(); // calls method "foo" of class "B" from namespace "A" // if class "A\B" not found, it tries to autoload class "A\B" ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RNXb7
function name:  (null)
number of ops:  32
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_NS_FCALL_BY_NAME                                    'A%5Cfoo'
          1        DO_FCALL                                      0          
   23     2        NEW                                              $1      'B%5CD'
          3        DO_FCALL                                      0          
          4        FREE                                                     $1
   26     5        NEW                                              $3      'C%5CE'
          6        DO_FCALL                                      0          
          7        FREE                                                     $3
   29     8        NEW                                              $5      'B'
          9        DO_FCALL                                      0          
         10        FREE                                                     $5
   32    11        NEW                                              $7      'D'
         12        DO_FCALL                                      0          
         13        FREE                                                     $7
   35    14        NEW                                              $9      'F'
         15        DO_FCALL                                      0          
         16        FREE                                                     $9
   40    17        INIT_FCALL_BY_NAME                                       'A%5CB%5Cfoo'
         18        DO_FCALL                                      0          
   42    19        INIT_STATIC_METHOD_CALL                                  'A%5CB', 'foo'
         20        DO_FCALL                                      0          
   45    21        INIT_STATIC_METHOD_CALL                                  'B%5CD', 'foo'
         22        DO_FCALL                                      0          
   48    23        INIT_FCALL_BY_NAME                                       'B%5Cfoo'
         24        DO_FCALL                                      0          
   50    25        INIT_STATIC_METHOD_CALL                                  'B', 'foo'
         26        DO_FCALL                                      0          
   55    27        INIT_STATIC_METHOD_CALL                                  'A%5CA%5CB', 'foo'
         28        DO_FCALL                                      0          
   58    29        INIT_STATIC_METHOD_CALL                                  'A%5CB', 'foo'
         30        DO_FCALL                                      0          
   60    31      > RETURN                                                   1

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

End of function a%5Cfoo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.96 ms | 1399 KiB | 14 Q