3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class X { public $names = array('bob', 'fred'); function get() { return $this->names; } } Class Y extends X { public $names = array('alice');//array_merge(parent::names, array('alice')); function __construct() { var_dump(parent::get($names)); } } $x = new X(); var_dump($x->names); $y = new Y(); var_dump($y->names);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lB0YA
function name:  (null)
number of ops:  15
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $2      'X'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   29     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~5      !0, 'names'
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                                 
   30     7        NEW                                              $7      'Y'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   31    10        INIT_FCALL                                               'var_dump'
         11        FETCH_OBJ_R                                      ~10     !1, 'names'
         12        SEND_VAL                                                 ~10
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class X:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lB0YA
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'names'
          1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function get

End of class X.

Class Y:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lB0YA
function name:  __construct
number of ops:  7
compiled vars:  !0 = $names
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'get'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4        SEND_VAR                                                 $1
          5        DO_ICALL                                                 
   24     6      > RETURN                                                   null

End of function __construct

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lB0YA
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'names'
          1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function get

End of class Y.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.97 ms | 1388 KiB | 15 Q