3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; public function __construct($bar) { $this->bar = $bar; } public function do_foo() { $this->bar(); } } class Bar { public function __invoke() { $this->do_bar(); } public function do_bar() { echo __METHOD__, "\n"; } } $foo = new Foo(new Bar()); $foo->do_foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiTWY
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'Foo'
          1        NEW                                              $2      'Bar'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   27     6        INIT_METHOD_CALL                                         !0, 'do_foo'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiTWY
function name:  __construct
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __construct

Function do_foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiTWY
function name:  do_foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_METHOD_CALL                                         'bar'
          1        DO_FCALL                                      0          
   12     2      > RETURN                                                   null

End of function do_foo

End of class Foo.

Class Bar:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiTWY
function name:  __invoke
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'do_bar'
          1        DO_FCALL                                      0          
   19     2      > RETURN                                                   null

End of function __invoke

Function do_bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiTWY
function name:  do_bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ECHO                                                     'Bar%3A%3Ado_bar'
          1        ECHO                                                     '%0A'
   23     2      > RETURN                                                   null

End of function do_bar

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.58 ms | 1395 KiB | 13 Q