3v4l.org

run code in 300+ PHP versions simultaneously
<?php // File "load.php". namespace Foo\Bar { class load { static public function arithmetic() { require_once __DIR__ . '/arithmetic.php'; } } } // File "arithmetic.php". namespace Foo\Bar\Functions { function add($a, $b) { return $a + $b; } const add = 'Foo\Bar\Functions\add'; } // User app. namespace Some\App { use Foo\Bar\load; use Foo\Bar\Functions as f; //load::arithmetic(); <-- commented out only for this demo (cause we have no real file) echo f\add(5, 6); // 11 $callable = f\add; echo $callable(5, 6); // 11 }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tZpLH
function name:  (null)
number of ops:  14
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   DECLARE_CONST                                            'Foo%5CBar%5CFunctions%5Cadd', 'Foo%5CBar%5CFunctions%5Cadd'
   28     1        INIT_FCALL                                               'foo%5Cbar%5Cfunctions%5Cadd'
          2        SEND_VAL                                                 5
          3        SEND_VAL                                                 6
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
   30     6        FETCH_CONSTANT                                   ~2      'Foo%5CBar%5CFunctions%5Cadd'
          7        ASSIGN                                                   !0, ~2
   31     8        INIT_DYNAMIC_CALL                                        !0
          9        SEND_VAL_EX                                              5
         10        SEND_VAL_EX                                              6
         11        DO_FCALL                                      0  $4      
         12        ECHO                                                     $4
   32    13      > RETURN                                                   1

Function foo%5Cbar%5Cfunctions%5Cadd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tZpLH
function name:  Foo\Bar\Functions\add
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ADD                                              ~2      !0, !1
          3      > RETURN                                                   ~2
   16     4*     > RETURN                                                   null

End of function foo%5Cbar%5Cfunctions%5Cadd

Class Foo\Bar\load:
Function arithmetic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tZpLH
function name:  arithmetic
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INCLUDE_OR_EVAL                                          '%2Fin%2Farithmetic.php', REQUIRE_ONCE
    8     1      > RETURN                                                   null

End of function arithmetic

End of class Foo\Bar\load.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.53 ms | 1403 KiB | 14 Q