3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $private = 0; public function addPrivate() { $this->private++; } public function getAPrivate() { return $this->private; } } class B extends A { public $private = 10; public function addBPrivate() { $this->private++; } public function getBPrivate() { return $this->private; } } $b = new B(); $b->addPrivate(); var_dump($b->getAPrivate()); var_dump($b->getBPrivate()); $b->addBPrivate(); var_dump($b->getAPrivate()); var_dump($b->getBPrivate());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lo7M9
function name:  (null)
number of ops:  28
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   35     3        INIT_METHOD_CALL                                         !0, 'addPrivate'
          4        DO_FCALL                                      0          
   36     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getAPrivate'
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
   37    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !0, 'getBPrivate'
         12        DO_FCALL                                      0  $7      
         13        SEND_VAR                                                 $7
         14        DO_ICALL                                                 
   40    15        INIT_METHOD_CALL                                         !0, 'addBPrivate'
         16        DO_FCALL                                      0          
   41    17        INIT_FCALL                                               'var_dump'
         18        INIT_METHOD_CALL                                         !0, 'getAPrivate'
         19        DO_FCALL                                      0  $10     
         20        SEND_VAR                                                 $10
         21        DO_ICALL                                                 
   42    22        INIT_FCALL                                               'var_dump'
         23        INIT_METHOD_CALL                                         !0, 'getBPrivate'
         24        DO_FCALL                                      0  $12     
         25        SEND_VAR                                                 $12
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class A:
Function addprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lo7M9
function name:  addPrivate
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   PRE_INC_OBJ                                              'private'
   10     1      > RETURN                                                   null

End of function addprivate

Function getaprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lo7M9
function name:  getAPrivate
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'private'
          1      > RETURN                                                   ~0
   15     2*     > RETURN                                                   null

End of function getaprivate

End of class A.

Class B:
Function addbprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lo7M9
function name:  addBPrivate
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   PRE_INC_OBJ                                              'private'
   25     1      > RETURN                                                   null

End of function addbprivate

Function getbprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lo7M9
function name:  getBPrivate
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                      ~0      'private'
          1      > RETURN                                                   ~0
   30     2*     > RETURN                                                   null

End of function getbprivate

Function addprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lo7M9
function name:  addPrivate
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   PRE_INC_OBJ                                              'private'
   10     1      > RETURN                                                   null

End of function addprivate

Function getaprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lo7M9
function name:  getAPrivate
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'private'
          1      > RETURN                                                   ~0
   15     2*     > RETURN                                                   null

End of function getaprivate

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.72 ms | 1400 KiB | 15 Q