3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { function __construct() { echo __CLASS__ , "\n"; } } class B extends A { function __construct() { parent::__construct(); echo __CLASS__ , "\n"; parent::__construct(); return "PHP\n"; } } $b = new B; echo $b->__construct();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DFGCa
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   NEW                                                  $1      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   24     3        INIT_METHOD_CALL                                             !0, '__construct'
          4        DO_FCALL                                          0  $4      
          5        ECHO                                                         $4
          6      > RETURN                                                       1

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

End of function __construct

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/DFGCa
function name:  __construct
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   INIT_STATIC_METHOD_CALL                                      
          1        DO_FCALL                                          0          
   15     2        ECHO                                                         'B'
          3        ECHO                                                         '%0A'
   16     4        INIT_STATIC_METHOD_CALL                                      
          5        DO_FCALL                                          0          
   18     6      > RETURN                                                       'PHP%0A'
   19     7*     > RETURN                                                       null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
225.28 ms | 2376 KiB | 13 Q