3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function a($x = 1) { $this->myvar = $x; } } class b extends a { public $myvar; public 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/hPlXq
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     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/hPlXq
function name:  a
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      1
    5     1        ASSIGN_OBJ                                               'myvar'
          2        OP_DATA                                                  !0
    6     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/hPlXq
function name:  b
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV_INIT                                        !0      2
   11     1        ASSIGN_OBJ                                               'myvar'
          2        OP_DATA                                                  !0
   12     3        INIT_STATIC_METHOD_CALL                                  'a'
          4        DO_FCALL                                      0          
   13     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/hPlXq
function name:  a
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      1
    5     1        ASSIGN_OBJ                                               'myvar'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function a

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.42 ms | 1395 KiB | 13 Q