3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { private function foo() { echo "C::foo\n"; } public function test() { // This should not call C::foo, it should fatal D::foo(); } } class D extends C { public function foo() { echo "D::foo\n"; } } $obj = new C; $obj->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i6Z2q
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function foo

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i6Z2q
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'D', 'foo'
          1        DO_FCALL                                      0          
    9     2      > RETURN                                                   null

End of function test

End of class C.

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

End of function foo

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i6Z2q
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'D', 'foo'
          1        DO_FCALL                                      0          
    9     2      > RETURN                                                   null

End of function test

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.48 ms | 1395 KiB | 13 Q