3v4l.org

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

Class A:
Function addprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4JfOY
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 add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4JfOY
function name:  add
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 add

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/4JfOY
function name:  addBPrivate
number of ops:  3
compiled vars:  !0 = $private
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        PRE_INC_OBJ                                              'private'
   25     2      > RETURN                                                   null

End of function addbprivate

Function getprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4JfOY
function name:  getPrivate
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 getprivate

Function addprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4JfOY
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 add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4JfOY
function name:  add
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 add

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.96 ms | 1400 KiB | 15 Q