3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Main { public function run() { echo "Deep item"; } } class Maker { public function getText() { return new Main(); } } class Tester { private $param; public function __constructor($param) { $this->param = $param; } public function go() { $this->param->run(); } } echo "\n instantiate Maker:\n"; $maker = new Maker(); echo "\n instantiate Tester:\n"; $tester = new Tester($maker->getText()); echo "\n Run Tester:\n"; $tester->go();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lsiC2
function name:  (null)
number of ops:  15
compiled vars:  !0 = $maker, !1 = $tester
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ECHO                                                     '%0A+instantiate+Maker%3A%0A'
   33     1        NEW                                              $2      'Maker'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   34     4        ECHO                                                     '%0A+instantiate+Tester%3A%0A'
   35     5        NEW                                              $5      'Tester'
          6        INIT_METHOD_CALL                                         !0, 'getText'
          7        DO_FCALL                                      0  $6      
          8        SEND_VAR_NO_REF_EX                                       $6
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $5
   36    11        ECHO                                                     '%0A+Run+Tester%3A%0A'
   37    12        INIT_METHOD_CALL                                         !1, 'go'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function run

End of class Main.

Class Maker:
Function gettext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lsiC2
function name:  getText
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $0      'Main'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   15     3*     > RETURN                                                   null

End of function gettext

End of class Maker.

Class Tester:
Function __constructor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lsiC2
function name:  __constructor
number of ops:  4
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        ASSIGN_OBJ                                               'param'
          2        OP_DATA                                                  !0
   24     3      > RETURN                                                   null

End of function __constructor

Function go:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lsiC2
function name:  go
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   FETCH_OBJ_R                                      ~0      'param'
          1        INIT_METHOD_CALL                                         ~0, 'run'
          2        DO_FCALL                                      0          
   29     3      > RETURN                                                   null

End of function go

End of class Tester.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.07 ms | 1399 KiB | 13 Q