3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class ClassA { public $property = array(); function __construct() { $this->property[] = "ClassA.construct"; } public function SetA() { $this->property[] = "ClassA.Set"; } } Class ClassB extends ClassA { function __construct() { $this->property[] = "ClassB.construct"; } function SetB() { $this->property[] = "ClassB.Set"; } } $classA = new ClassA(); $classA->SetA(); $classB = new ClassB(); $classB->SetB(); print_r($classB->property);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keJ2a
function name:  (null)
number of ops:  15
compiled vars:  !0 = $classA, !1 = $classB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $2      'ClassA'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   23     3        INIT_METHOD_CALL                                         !0, 'SetA'
          4        DO_FCALL                                      0          
   24     5        NEW                                              $6      'ClassB'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   25     8        INIT_METHOD_CALL                                         !1, 'SetB'
          9        DO_FCALL                                      0          
   26    10        INIT_FCALL                                               'print_r'
         11        FETCH_OBJ_R                                      ~10     !1, 'property'
         12        SEND_VAL                                                 ~10
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function __construct

Function seta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keJ2a
function name:  SetA
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_W                                      $0      'property'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'ClassA.Set'
   10     3      > RETURN                                                   null

End of function seta

End of class ClassA.

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

End of function __construct

Function setb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keJ2a
function name:  SetB
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_W                                      $0      'property'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'ClassB.Set'
   19     3      > RETURN                                                   null

End of function setb

Function seta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keJ2a
function name:  SetA
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_W                                      $0      'property'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'ClassA.Set'
   10     3      > RETURN                                                   null

End of function seta

End of class ClassB.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.3 ms | 1400 KiB | 15 Q