3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $c = 0; public function A($c) { print($this->c); print($c); } } class B extends A { public function B($c) { $c++; $this->c++; $_c = $this->c > 0 ? $c : -1; parent::A($_c); } } $b = new B(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RfdrY
function name:  (null)
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     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/RfdrY
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        FETCH_OBJ_R                                      ~1      'c'
          2        ECHO                                                     ~1
    9     3        ECHO                                                     !0
   10     4      > RETURN                                                   null

End of function a

End of class A.

Class B:
Function b:
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/RfdrY
function name:  B
number of ops:  14
compiled vars:  !0 = $c, !1 = $_c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        PRE_INC                                                  !0
   18     2        PRE_INC_OBJ                                              'c'
   19     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
   20    10        INIT_STATIC_METHOD_CALL                                  'A'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   21    13      > RETURN                                                   null

End of function b

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RfdrY
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        FETCH_OBJ_R                                      ~1      'c'
          2        ECHO                                                     ~1
    9     3        ECHO                                                     !0
   10     4      > RETURN                                                   null

End of function a

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.64 ms | 1399 KiB | 13 Q