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) . "\n"; // 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/s5oBb
function name:  (null)
number of ops:  15
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        CONCAT                                           ~2      $1, '%0A'
          6        ECHO                                                     ~2
   30     7        FETCH_CONSTANT                                   ~3      'Foo%5CBar%5CFunctions%5Cadd'
          8        ASSIGN                                                   !0, ~3
   31     9        INIT_DYNAMIC_CALL                                        !0
         10        SEND_VAL_EX                                              5
         11        SEND_VAL_EX                                              6
         12        DO_FCALL                                      0  $5      
         13        ECHO                                                     $5
   32    14      > 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/s5oBb
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/s5oBb
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:
163.48 ms | 1390 KiB | 14 Q