3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TopLevel { public $arg; public function __construct(string $arg) { printf("Top level: %s\n", $arg); $this->arg = $arg; } } class MidLevel extends TopLevel { public function __construct(string $arg) { printf("Mid level: %s\n", $arg); parent::__construct($arg); } } class EndLevel extends MidLevel { public function __construct(string $arg) { printf("End level: %s\n", $arg); TopLevel::__construct($arg); } } $mid = new MidLevel('mid'); var_dump($mid->arg); echo "---\n"; $end = new EndLevel('end'); var_dump($end->arg);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iir32
function name:  (null)
number of ops:  18
compiled vars:  !0 = $mid, !1 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $2      'MidLevel'
          1        SEND_VAL_EX                                              'mid'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   33     4        INIT_FCALL                                               'var_dump'
          5        FETCH_OBJ_R                                      ~5      !0, 'arg'
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                                 
   35     8        ECHO                                                     '---%0A'
   37     9        NEW                                              $7      'EndLevel'
         10        SEND_VAL_EX                                              'end'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $7
   38    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~10     !1, 'arg'
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Class TopLevel:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iir32
function name:  __construct
number of ops:  8
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'printf'
          2        SEND_VAL                                                 'Top+level%3A+%25s%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   10     5        ASSIGN_OBJ                                               'arg'
          6        OP_DATA                                                  !0
   11     7      > RETURN                                                   null

End of function __construct

End of class TopLevel.

Class MidLevel:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iir32
function name:  __construct
number of ops:  9
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'printf'
          2        SEND_VAL                                                 'Mid+level%3A+%25s%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   19     5        INIT_STATIC_METHOD_CALL                                  
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   20     8      > RETURN                                                   null

End of function __construct

End of class MidLevel.

Class EndLevel:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iir32
function name:  __construct
number of ops:  9
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        INIT_FCALL                                               'printf'
          2        SEND_VAL                                                 'End+level%3A+%25s%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   28     5        INIT_STATIC_METHOD_CALL                                  'TopLevel'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   29     8      > RETURN                                                   null

End of function __construct

End of class EndLevel.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.6 ms | 1075 KiB | 15 Q