3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Super { public $a = "nein"; public function talk() { echo 'Super says hello!'; echo $this->a; } } class Child extends Super { public $a = "hi"; public function talk() { echo 'Child says hello!'; echo $this->a; } } $action = new ReflectionMethod('Super', 'talk'); $object = new Child(); $action->invoke($object);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWhO1
function name:  (null)
number of ops:  12
compiled vars:  !0 = $action, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'ReflectionMethod'
          1        SEND_VAL_EX                                              'Super'
          2        SEND_VAL_EX                                              'talk'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   19     5        NEW                                              $5      'Child'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   20     8        INIT_METHOD_CALL                                         !0, 'invoke'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class Super:
Function talk:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWhO1
function name:  talk
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'Super+says+hello%21'
    6     1        FETCH_OBJ_R                                      ~0      'a'
          2        ECHO                                                     ~0
    7     3      > RETURN                                                   null

End of function talk

End of class Super.

Class Child:
Function talk:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWhO1
function name:  talk
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'Child+says+hello%21'
   14     1        FETCH_OBJ_R                                      ~0      'a'
          2        ECHO                                                     ~0
   15     3      > RETURN                                                   null

End of function talk

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.98 ms | 1394 KiB | 13 Q