3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { function a ($x = 1) { $this->myvar = $x; } } class b extends a { var $myvar; function b ($x = 2) { $this->myvar = $x; parent::a(); } } $obj = new b; echo $obj->myvar;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9FcaD
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        FETCH_OBJ_R                                      ~4      !0, 'myvar'
          4        ECHO                                                     ~4
          5      > RETURN                                                   1

Class a:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9FcaD
function name:  a
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      1
    7     1        ASSIGN_OBJ                                               'myvar'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function a

End of class a.

Class b:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9FcaD
function name:  b
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV_INIT                                        !0      2
   15     1        ASSIGN_OBJ                                               'myvar'
          2        OP_DATA                                                  !0
   16     3        INIT_STATIC_METHOD_CALL                                  'a'
          4        DO_FCALL                                      0          
   17     5      > 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/9FcaD
function name:  a
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      1
    7     1        ASSIGN_OBJ                                               'myvar'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function a

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.06 ms | 1395 KiB | 13 Q