3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CommonPage { protected function getContent() { return "default content"; } public function render() { return "<html>{$this->getContent()}</html>"; } } class OfferPage extends CommonPage { protected function getContent() { return "offer content"; } } class ProductPage extends OfferPage{ protected function getContent() { return "product content"; } } $hC = new ProductPage(); echo $hC->render(); // default content
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7eKG
function name:  (null)
number of ops:  7
compiled vars:  !0 = $hC
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'ProductPage'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   28     3        INIT_METHOD_CALL                                         !0, 'render'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class CommonPage:
Function getcontent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7eKG
function name:  getContent
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'default+content'
    6     1*     > RETURN                                                   null

End of function getcontent

Function render:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7eKG
function name:  render
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ROPE_INIT                                     3  ~2      '%3Chtml%3E'
          1        INIT_METHOD_CALL                                         'getContent'
          2        DO_FCALL                                      0  $0      
          3        ROPE_ADD                                      1  ~2      ~2, $0
          4        ROPE_END                                      2  ~1      ~2, '%3C%2Fhtml%3E'
          5      > RETURN                                                   ~1
   10     6*     > RETURN                                                   null

End of function render

End of class CommonPage.

Class OfferPage:
Function getcontent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7eKG
function name:  getContent
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   'offer+content'
   16     1*     > RETURN                                                   null

End of function getcontent

Function render:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7eKG
function name:  render
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ROPE_INIT                                     3  ~2      '%3Chtml%3E'
          1        INIT_METHOD_CALL                                         'getContent'
          2        DO_FCALL                                      0  $0      
          3        ROPE_ADD                                      1  ~2      ~2, $0
          4        ROPE_END                                      2  ~1      ~2, '%3C%2Fhtml%3E'
          5      > RETURN                                                   ~1
   10     6*     > RETURN                                                   null

End of function render

End of class OfferPage.

Class ProductPage:
Function getcontent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7eKG
function name:  getContent
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   'product+content'
   22     1*     > RETURN                                                   null

End of function getcontent

Function render:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7eKG
function name:  render
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ROPE_INIT                                     3  ~2      '%3Chtml%3E'
          1        INIT_METHOD_CALL                                         'getContent'
          2        DO_FCALL                                      0  $0      
          3        ROPE_ADD                                      1  ~2      ~2, $0
          4        ROPE_END                                      2  ~1      ~2, '%3C%2Fhtml%3E'
          5      > RETURN                                                   ~1
   10     6*     > RETURN                                                   null

End of function render

End of class ProductPage.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.18 ms | 1399 KiB | 13 Q