3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a = []; function run() { $this->a[] = 'A'; } } class B extends A { function run() { parent::run(); $this->a[] = 'B'; } } class C extends B { function run() { A::run(); $this->a[] = 'C'; } } $c = new C(); $c->run(); var_dump($c->a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MuYqI
function name:  (null)
number of ops:  10
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, 'run'
          4        DO_FCALL                                      0          
   26     5        INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~5      !0, 'a'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function run

End of class A.

Class B:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MuYqI
function name:  run
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_STATIC_METHOD_CALL                                  'run'
          1        DO_FCALL                                      0          
   13     2        FETCH_OBJ_W                                      $1      'a'
          3        ASSIGN_DIM                                               $1
          4        OP_DATA                                                  'B'
   14     5      > RETURN                                                   null

End of function run

End of class B.

Class C:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MuYqI
function name:  run
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'run'
          1        DO_FCALL                                      0          
   20     2        FETCH_OBJ_W                                      $1      'a'
          3        ASSIGN_DIM                                               $1
          4        OP_DATA                                                  'C'
   21     5      > RETURN                                                   null

End of function run

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.96 ms | 1396 KiB | 15 Q