3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a{ public function __construct(){ echo 'sub_class'; } public function aa(){ echo 'aa'; } } class b{ public function __construct(){ return new a(); } public function cc(){ echo 'cc'; } } $v = new b(); echo get_class($v); $v->aa(); $v->cc();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fd86U
function name:  (null)
number of ops:  10
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        GET_CLASS                                        ~4      !0
          4        ECHO                                                     ~4
   20     5        INIT_METHOD_CALL                                         !0, 'aa'
          6        DO_FCALL                                      0          
   21     7        INIT_METHOD_CALL                                         !0, 'cc'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fd86U
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'sub_class'
    5     1      > RETURN                                                   null

End of function __construct

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

End of function aa

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/Fd86U
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $0      'a'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   13     3*     > RETURN                                                   null

End of function __construct

Function cc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fd86U
function name:  cc
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     'cc'
   16     1      > RETURN                                                   null

End of function cc

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.18 ms | 1386 KiB | 13 Q