3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace Controllers{ class A{ public function test() { echo 'meow'; } } } namespace Test{ class B{ private $controller; public function run() { $this->controller = 'A'; $newClassName = "\Controllers\\" . $this->controller; $test = new $newClassName; $test->test(); } } $b = new B(); $b->run(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a86Md
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   NEW                                                  $1      'Test%5CB'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   23     3        INIT_METHOD_CALL                                             !0, 'run'
          4        DO_FCALL                                          0          
   24     5      > RETURN                                                       1

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

End of function test

End of class Controllers\A.

Class Test\B:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a86Md
function name:  run
number of ops:  12
compiled vars:  !0 = $newClassName, !1 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   ASSIGN_OBJ                                                   'controller'
          1        OP_DATA                                                      'A'
   17     2        FETCH_OBJ_R                                          ~3      'controller'
          3        CONCAT                                               ~4      '%5CControllers%5C', ~3
          4        ASSIGN                                                       !0, ~4
   18     5        FETCH_CLASS                                       0  $6      !0
          6        NEW                                                  $7      $6
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !1, $7
   19     9        INIT_METHOD_CALL                                             !1, 'test'
         10        DO_FCALL                                          0          
   20    11      > RETURN                                                       null

End of function run

End of class Test\B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.94 ms | 2534 KiB | 12 Q