3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $collectors = array(); public function set($collector) { $this->collectors[] = $collector; } public function dumpCollectors() { var_dump($this->collectors); } } class B extends A { private $collectors = array(); } $b = new B(); $b->set("coll1"); $b->set("c2"); $b->dumpCollectors();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9nGKI
function name:  (null)
number of ops:  12
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'set'
          4        SEND_VAL_EX                                              'coll1'
          5        DO_FCALL                                      0          
   27     6        INIT_METHOD_CALL                                         !0, 'set'
          7        SEND_VAL_EX                                              'c2'
          8        DO_FCALL                                      0          
   29     9        INIT_METHOD_CALL                                         !0, 'dumpCollectors'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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

End of function set

Function dumpcollectors:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9nGKI
function name:  dumpCollectors
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'collectors'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   15     4      > RETURN                                                   null

End of function dumpcollectors

End of class A.

Class B:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9nGKI
function name:  set
number of ops:  5
compiled vars:  !0 = $collector
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        FETCH_OBJ_W                                      $1      'collectors'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
   10     4      > RETURN                                                   null

End of function set

Function dumpcollectors:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9nGKI
function name:  dumpCollectors
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'collectors'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   15     4      > RETURN                                                   null

End of function dumpcollectors

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.25 ms | 1400 KiB | 15 Q