3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $v = 'a'; public function init() { echo "A::init, {$this->v}\n"; } } class B extends A { public $v = 'b'; } class C extends B { public $v = 'c'; public function init() { echo "C::init, {$this->v}\n"; $grandPa = get_parent_class(get_parent_class($this)); $grandPa::init(); } } $c = new C; $c->init();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/geFXv
function name:  (null)
number of ops:  6
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'init'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class A:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/geFXv
function name:  init
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ROPE_INIT                                     3  ~2      'A%3A%3Ainit%2C+'
          1        FETCH_OBJ_R                                      ~0      'v'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    8     5      > RETURN                                                   null

End of function init

End of class A.

Class B:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/geFXv
function name:  init
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ROPE_INIT                                     3  ~2      'A%3A%3Ainit%2C+'
          1        FETCH_OBJ_R                                      ~0      'v'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    8     5      > RETURN                                                   null

End of function init

End of class B.

Class C:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/geFXv
function name:  init
number of ops:  17
compiled vars:  !0 = $grandPa
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ROPE_INIT                                     3  ~3      'C%3A%3Ainit%2C+'
          1        FETCH_OBJ_R                                      ~1      'v'
          2        ROPE_ADD                                      1  ~3      ~3, ~1
          3        ROPE_END                                      2  ~2      ~3, '%0A'
          4        ECHO                                                     ~2
   19     5        INIT_FCALL                                               'get_parent_class'
          6        INIT_FCALL                                               'get_parent_class'
          7        FETCH_THIS                                       ~5      
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !0, $7
   20    13        FETCH_CLASS                                   0  $9      !0
         14        INIT_STATIC_METHOD_CALL                                  $9, 'init'
         15        DO_FCALL                                      0          
   21    16      > RETURN                                                   null

End of function init

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.49 ms | 1018 KiB | 14 Q