3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { private int $pv = 0; protected int $pt = 0; public int $pb = 0; public function setBase(int $i) { $this->pv = $i; $this->pt = $i; $this->pb = $i; } public function dump() { echo "private(base):$this->pv; protected(base):$this->pt; public(base):$this->pb\n"; } }; class Derived extends Base { private int $pv = 0; protected int $pt = 0; public int $pb = 0; public function setDerived(int $i) { $this->pv = $i; $this->pt = $i; $this->pb = $i; } public function dump() { parent::dump(); echo "private(derived):$this->pv; protected(derived):$this->pt; public(derived):$this->pb\n"; } }; $o = new Derived; $o->setBase(2); $o->dump(); $o->setDerived(6); $o->dump();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JfJOY
function name:  (null)
number of ops:  14
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Derived'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'setBase'
          4        SEND_VAL_EX                                              2
          5        DO_FCALL                                      0          
   22     6        INIT_METHOD_CALL                                         !0, 'dump'
          7        DO_FCALL                                      0          
   23     8        INIT_METHOD_CALL                                         !0, 'setDerived'
          9        SEND_VAL_EX                                              6
         10        DO_FCALL                                      0          
   24    11        INIT_METHOD_CALL                                         !0, 'dump'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class Base:
Function setbase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JfJOY
function name:  setBase
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'pv'
          2        OP_DATA                                                  !0
          3        ASSIGN_OBJ                                               'pt'
          4        OP_DATA                                                  !0
          5        ASSIGN_OBJ                                               'pb'
          6        OP_DATA                                                  !0
          7      > RETURN                                                   null

End of function setbase

Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JfJOY
function name:  dump
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ROPE_INIT                                     7  ~4      'private%28base%29%3A'
          1        FETCH_OBJ_R                                      ~0      'pv'
          2        ROPE_ADD                                      1  ~4      ~4, ~0
          3        ROPE_ADD                                      2  ~4      ~4, '%3B+protected%28base%29%3A'
          4        FETCH_OBJ_R                                      ~1      'pt'
          5        ROPE_ADD                                      3  ~4      ~4, ~1
          6        ROPE_ADD                                      4  ~4      ~4, '%3B+public%28base%29%3A'
          7        FETCH_OBJ_R                                      ~2      'pb'
          8        ROPE_ADD                                      5  ~4      ~4, ~2
          9        ROPE_END                                      6  ~3      ~4, '%0A'
         10        ECHO                                                     ~3
         11      > RETURN                                                   null

End of function dump

End of class Base.

Class Derived:
Function setderived:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JfJOY
function name:  setDerived
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'pv'
          2        OP_DATA                                                  !0
          3        ASSIGN_OBJ                                               'pt'
          4        OP_DATA                                                  !0
          5        ASSIGN_OBJ                                               'pb'
          6        OP_DATA                                                  !0
          7      > RETURN                                                   null

End of function setderived

Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JfJOY
function name:  dump
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'dump'
          1        DO_FCALL                                      0          
          2        ROPE_INIT                                     7  ~5      'private%28derived%29%3A'
          3        FETCH_OBJ_R                                      ~1      'pv'
          4        ROPE_ADD                                      1  ~5      ~5, ~1
          5        ROPE_ADD                                      2  ~5      ~5, '%3B+protected%28derived%29%3A'
          6        FETCH_OBJ_R                                      ~2      'pt'
          7        ROPE_ADD                                      3  ~5      ~5, ~2
          8        ROPE_ADD                                      4  ~5      ~5, '%3B+public%28derived%29%3A'
          9        FETCH_OBJ_R                                      ~3      'pb'
         10        ROPE_ADD                                      5  ~5      ~5, ~3
         11        ROPE_END                                      6  ~4      ~5, '%0A'
         12        ECHO                                                     ~4
         13      > RETURN                                                   null

End of function dump

Function setbase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JfJOY
function name:  setBase
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'pv'
          2        OP_DATA                                                  !0
          3        ASSIGN_OBJ                                               'pt'
          4        OP_DATA                                                  !0
          5        ASSIGN_OBJ                                               'pb'
          6        OP_DATA                                                  !0
          7      > RETURN                                                   null

End of function setbase

End of class Derived.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.68 ms | 1004 KiB | 13 Q