3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class A { public function foo() { // $this refers to $b/B regardless of the fact that the code is in A::foo $this->bar(); } public function bar() { echo "A's bar"; } } class B extends A { public function foo() { parent::foo(); } public function bar() { echo "B's bar"; } } $b = new B(); $b->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1T04
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   NEW                                                  $1      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   23     3        INIT_METHOD_CALL                                             !0, 'foo'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

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

End of function foo

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

End of function bar

End of class A.

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

End of function foo

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

End of function bar

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.61 ms | 1988 KiB | 13 Q