3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $value; public function setValue($val) { $this->value = $val; } public function getValue() { return $this->value; } } class B extends A { private $value; public function setValue($val) { $this->value = $val; } } $a = new A; $b = new B; $a->setValue(123); $b->setValue(544); var_dump($a->getValue(), $b->getValue(), $a, $b);
based on jeQ2E
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0MejC
function name:  (null)
number of ops:  26
compiled vars:  !0 = $a, !1 = $b
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  18     1        NOP                                                      
         2        NOP                                                      
  30     3        NEW                                              $5      :-3
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $5
  31     6        NEW                                              $8      :-1
         7        DO_FCALL                                      0          
         8        ASSIGN                                                   !1, $8
  32     9        INIT_METHOD_CALL                                         !0, 'setValue'
        10        SEND_VAL_EX                                              123
        11        DO_FCALL                                      0          
  33    12        INIT_METHOD_CALL                                         !1, 'setValue'
        13        SEND_VAL_EX                                              544
        14        DO_FCALL                                      0          
  35    15        INIT_FCALL                                               'var_dump'
        16        INIT_METHOD_CALL                                         !0, 'getValue'
        17        DO_FCALL                                      0  $13     
        18        SEND_VAR                                                 $13
        19        INIT_METHOD_CALL                                         !1, 'getValue'
        20        DO_FCALL                                      0  $14     
        21        SEND_VAR                                                 $14
        22        SEND_VAR                                                 !0
        23        SEND_VAR                                                 !1
        24        DO_ICALL                                                 
        25      > RETURN                                                   1

Class A:
Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0MejC
function name:  setValue
number of ops:  4
compiled vars:  !0 = $val
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   7     0  E >   RECV                                             !0      
   9     1        ASSIGN_OBJ                                               'value'
         2        OP_DATA                                                  !0
  10     3      > RETURN                                                   null

End of function setvalue

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

End of function getvalue

End of class A.

Class B:
Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0MejC
function name:  setValue
number of ops:  4
compiled vars:  !0 = $val
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  22     0  E >   RECV                                             !0      
  24     1        ASSIGN_OBJ                                               'value'
         2        OP_DATA                                                  !0
  25     3      > RETURN                                                   null

End of function setvalue

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

End of function getvalue

End of class B.

Generated using Vulcan Logic Dumper, using php 7.3.0