3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __invoke() { echo "Invoking A() Class"; } } class B { public $a; public function __construct() { $this->a = new A(); } public function __invoke() { echo "Invoking B() Class"; } } $a = new A(); $b = new B(); $a(); $b(); ($b->a)(); $c = $b->a; $c();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rqdov
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $3      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   26     3        NEW                                              $6      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   27     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
   28     8        INIT_DYNAMIC_CALL                                        !1
          9        DO_FCALL                                      0          
   29    10        FETCH_OBJ_R                                      ~11     !1, 'a'
         11        INIT_DYNAMIC_CALL                                        ~11
         12        DO_FCALL                                      0          
   30    13        FETCH_OBJ_R                                      ~13     !1, 'a'
         14        ASSIGN                                                   !2, ~13
   31    15        INIT_DYNAMIC_CALL                                        !2
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

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

End of function __invoke

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rqdov
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'a'
          3        OP_DATA                                                  $1
   17     4      > RETURN                                                   null

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rqdov
function name:  __invoke
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'Invoking+B%28%29+Class'
   22     1      > RETURN                                                   null

End of function __invoke

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.85 ms | 1395 KiB | 13 Q