3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected const BLOP = 1; public function get() { return static::BLOP; } public function get2() { return self::BLOP; } } class B extends A { protected const BLOP = 2; } $o = new B(); var_dump($o->get(), $o->get2());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XCCbo
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'get'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        INIT_METHOD_CALL                                         !0, 'get2'
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function get

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

End of function get2

End of class A.

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

End of function get

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

End of function get2

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
201.75 ms | 1396 KiB | 15 Q