3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function example() { echo "I am the original function A::example().<br />\n"; } } class B extends A { function example() { echo "I am the redefined function B::example().<br />\n"; A::example(); } } // there is no object of class A. // this will print // I am the original function A::example().<br /> A::example(); // create an object of class B. $b = new B; // this will print // I am the redefined function B::example().<br /> // I am the original function A::example().<br /> $b->example();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CPSrO
function name:  (null)
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'example'
          1        DO_FCALL                                      0          
   21     2        NEW                                              $2      'B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   26     5        INIT_METHOD_CALL                                         !0, 'example'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class A:
Function example:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CPSrO
function name:  example
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'I+am+the+original+function+A%3A%3Aexample%28%29.%3Cbr+%2F%3E%0A'
    5     1      > RETURN                                                   null

End of function example

End of class A.

Class B:
Function example:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CPSrO
function name:  example
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'I+am+the+redefined+function+B%3A%3Aexample%28%29.%3Cbr+%2F%3E%0A'
   11     1        INIT_STATIC_METHOD_CALL                                  'A', 'example'
          2        DO_FCALL                                      0          
   12     3      > RETURN                                                   null

End of function example

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.12 ms | 1385 KiB | 13 Q