3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { public function getString() { return $this->getStringProtected(); } protected function getStringProtected() { return "B"; } } Class A extends B { protected function getStringProtected() { return "A"; } } $a = new A(); echo $a->getString();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hqa6e
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'getString'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class B:
Function getstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hqa6e
function name:  getString
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'getStringProtected'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    8     3*     > RETURN                                                   null

End of function getstring

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

End of function getstringprotected

End of class B.

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

End of function getstringprotected

Function getstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hqa6e
function name:  getString
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'getStringProtected'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    8     3*     > RETURN                                                   null

End of function getstring

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.51 ms | 1395 KiB | 13 Q