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" F(); // first tries to call "F" defined in namespace "A" // then calls global function "F" // class references new B(); // creates object of class "B" defined in namespace "A" // if not found, it tries to autoload class "A\B" 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/DRVCp
function name:  (null)
number of ops:  37
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          
   20     2        INIT_NS_FCALL_BY_NAME                                    'A%5CF'
          3        DO_FCALL                                      0          
   25     4        NEW                                              $2      'A%5CB'
          5        DO_FCALL                                      0          
          6        FREE                                                     $2
   28     7        NEW                                              $4      'B%5CD'
          8        DO_FCALL                                      0          
          9        FREE                                                     $4
   31    10        NEW                                              $6      'C%5CE'
         11        DO_FCALL                                      0          
         12        FREE                                                     $6
   34    13        NEW                                              $8      'B'
         14        DO_FCALL                                      0          
         15        FREE                                                     $8
   37    16        NEW                                              $10     'D'
         17        DO_FCALL                                      0          
         18        FREE                                                     $10
   40    19        NEW                                              $12     'F'
         20        DO_FCALL                                      0          
         21        FREE                                                     $12
   45    22        INIT_FCALL_BY_NAME                                       'A%5CB%5Cfoo'
         23        DO_FCALL                                      0          
   47    24        INIT_STATIC_METHOD_CALL                                  'A%5CB', 'foo'
         25        DO_FCALL                                      0          
   50    26        INIT_STATIC_METHOD_CALL                                  'B%5CD', 'foo'
         27        DO_FCALL                                      0          
   53    28        INIT_FCALL_BY_NAME                                       'B%5Cfoo'
         29        DO_FCALL                                      0          
   55    30        INIT_STATIC_METHOD_CALL                                  'B', 'foo'
         31        DO_FCALL                                      0          
   60    32        INIT_STATIC_METHOD_CALL                                  'A%5CA%5CB', 'foo'
         33        DO_FCALL                                      0          
   63    34        INIT_STATIC_METHOD_CALL                                  'A%5CB', 'foo'
         35        DO_FCALL                                      0          
   65    36      > RETURN                                                   1

Function a%5Cfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DRVCp
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:
183.58 ms | 1403 KiB | 15 Q