3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myParent { protected function foo() { echo 'parent foo'; } } class mySon extends myParent { //private function foo() { echo 'son foo'; } } class myDaughter extends myParent { public function bar() { $son = new mySon; $son->foo(); } } $daughter = new myDaughter; $daughter->bar(); // prints "son foo"
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMllB
function name:  (null)
number of ops:  6
compiled vars:  !0 = $daughter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'myDaughter'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function foo

End of class myParent.

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

End of function foo

End of class mySon.

Class myDaughter:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMllB
function name:  bar
number of ops:  6
compiled vars:  !0 = $son
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'mySon'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function bar

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

End of function foo

End of class myDaughter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.8 ms | 1395 KiB | 13 Q