3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $c = 0; public function A($c) { $this->init($c); } public function init($c) { print($this->c); print($c); } } class B extends A { // public function B($c) // { // parent::A($c); // } public function init($c) { $c++; $this->c++; $_c = $this->c > 0 ? $c : -1; parent::init($_c); } } $b = new B(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2lmpF
function name:  (null)
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $1      'B'
          1        SEND_VAL_EX                                              2
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4      > RETURN                                                   1

Class A:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2lmpF
function name:  A
number of ops:  5
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        INIT_METHOD_CALL                                         'init'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    9     4      > RETURN                                                   null

End of function a

Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2lmpF
function name:  init
number of ops:  5
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_R                                      ~1      'c'
          2        ECHO                                                     ~1
   14     3        ECHO                                                     !0
   15     4      > RETURN                                                   null

End of function init

End of class A.

Class B:
Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2lmpF
function name:  init
number of ops:  14
compiled vars:  !0 = $c, !1 = $_c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        PRE_INC                                                  !0
   28     2        PRE_INC_OBJ                                              'c'
   29     3        FETCH_OBJ_R                                      ~4      'c'
          4        IS_SMALLER                                               0, ~4
          5      > JMPZ                                                     ~5, ->8
          6    >   QM_ASSIGN                                        ~6      !0
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~6      -1
          9    >   ASSIGN                                                   !1, ~6
   30    10        INIT_STATIC_METHOD_CALL                                  'init'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   31    13      > RETURN                                                   null

End of function init

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2lmpF
function name:  A
number of ops:  5
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        INIT_METHOD_CALL                                         'init'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    9     4      > RETURN                                                   null

End of function a

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.79 ms | 1399 KiB | 13 Q