3v4l.org

run code in 500+ PHP versions simultaneously
<?php class a { function __construct() { } function __invoke() { echo("Invoked\n"); } } $a = new a(); $a(); // Prints: Invoked class b { private $x; function __construct() { $this->x = new a(); $this->x(); } } $b = new b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Pu60
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $2      'a'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
    9     3        INIT_DYNAMIC_CALL                                            !0
          4        DO_FCALL                                          0          
   21     5        NEW                                                  $6      'b'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $6
          8      > RETURN                                                       1

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Pu60
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E > > 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/3Pu60
function name:  __invoke
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                         'Invoked%0A'
          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/3Pu60
function name:  __construct
number of ops:  7
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                                                   'x'
          3        OP_DATA                                                      $1
   17     4        INIT_METHOD_CALL                                             'x'
          5        DO_FCALL                                          0          
   18     6      > RETURN                                                       null

End of function __construct

End of class b.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.73 ms | 2975 KiB | 13 Q