3v4l.org

run code in 300+ PHP versions simultaneously
<?php class classA { public $prop1 = "I'm a class property!"; public function setProperty($newval) { $this->prop1 = $newval; } protected function getProperty() { return $this->prop1 . "<br />"; } } class classB extends classA { public function getProperty() { return 'B: ' . $this->prop1 . "<br />"; } public function callProtected() { return $this->getProperty(); } public function callProtected2() { return parent::getProperty(); } } $testobj = new classB; echo $testobj->callProtected(); echo $testobj->callProtected2(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTeeF
function name:  (null)
number of ops:  10
compiled vars:  !0 = $testobj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $1      'classB'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   33     3        INIT_METHOD_CALL                                         !0, 'callProtected'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   34     6        INIT_METHOD_CALL                                         !0, 'callProtected2'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
   35     9      > RETURN                                                   1

Class classA:
Function setproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTeeF
function name:  setProperty
number of ops:  4
compiled vars:  !0 = $newval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'prop1'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function setproperty

Function getproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTeeF
function name:  getProperty
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'prop1'
          1        CONCAT                                           ~1      ~0, '%3Cbr+%2F%3E'
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function getproperty

End of class classA.

Class classB:
Function getproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTeeF
function name:  getProperty
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'prop1'
          1        CONCAT                                           ~1      'B%3A+', ~0
          2        CONCAT                                           ~2      ~1, '%3Cbr+%2F%3E'
          3      > RETURN                                                   ~2
   20     4*     > RETURN                                                   null

End of function getproperty

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

End of function callprotected

Function callprotected2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTeeF
function name:  callProtected2
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_STATIC_METHOD_CALL                                  'getProperty'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   28     3*     > RETURN                                                   null

End of function callprotected2

Function setproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTeeF
function name:  setProperty
number of ops:  4
compiled vars:  !0 = $newval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'prop1'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function setproperty

End of class classB.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.45 ms | 1399 KiB | 13 Q