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__;} new F(); // function calls \F\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/kXIer
function name:  (null)
number of ops:  35
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $0      'C%5CE'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
   13     3        INIT_FCALL_BY_NAME                                       'F%5Cfoo'
          4        DO_FCALL                                      0          
   22     5        NEW                                              $3      'B%5CD'
          6        DO_FCALL                                      0          
          7        FREE                                                     $3
   25     8        NEW                                              $5      'C%5CE'
          9        DO_FCALL                                      0          
         10        FREE                                                     $5
   28    11        NEW                                              $7      'B'
         12        DO_FCALL                                      0          
         13        FREE                                                     $7
   31    14        NEW                                              $9      'D'
         15        DO_FCALL                                      0          
         16        FREE                                                     $9
   34    17        NEW                                              $11     'F'
         18        DO_FCALL                                      0          
         19        FREE                                                     $11
   39    20        INIT_FCALL_BY_NAME                                       'A%5CB%5Cfoo'
         21        DO_FCALL                                      0          
   41    22        INIT_STATIC_METHOD_CALL                                  'A%5CB', 'foo'
         23        DO_FCALL                                      0          
   44    24        INIT_STATIC_METHOD_CALL                                  'B%5CD', 'foo'
         25        DO_FCALL                                      0          
   47    26        INIT_FCALL_BY_NAME                                       'B%5Cfoo'
         27        DO_FCALL                                      0          
   49    28        INIT_STATIC_METHOD_CALL                                  'B', 'foo'
         29        DO_FCALL                                      0          
   54    30        INIT_STATIC_METHOD_CALL                                  'A%5CA%5CB', 'foo'
         31        DO_FCALL                                      0          
   57    32        INIT_STATIC_METHOD_CALL                                  'A%5CB', 'foo'
         33        DO_FCALL                                      0          
   59    34      > RETURN                                                   1

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