3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $c = 1; public function aMethod() { return $this->c; } } class B extends A { private $c = 2; public function bMethod() { return $this->c; } } $b = new B(); var_dump($b->aMethod(), $b->bMethod()); print_r($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X6sGO
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'aMethod'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        INIT_METHOD_CALL                                         !0, 'bMethod'
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
   19    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class A:
Function amethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X6sGO
function name:  aMethod
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_OBJ_R                                      ~0      'c'
          1      > RETURN                                                   ~0
    7     2*     > RETURN                                                   null

End of function amethod

End of class A.

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

End of function bmethod

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

End of function amethod

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.13 ms | 1396 KiB | 17 Q