3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends ArrayObject { public $public; private $private; protected $protected; public function __construct ($input = array()) { parent::__construct($input, ArrayObject::ARRAY_AS_PROPS); } } class B extends ArrayObject { public $public; private $private; protected $protected; public function __construct ($input = array()) { } } class C extends ArrayObject { public $public; private $private; protected $protected; public function __construct ($input = array()) { parent::__construct($input, ArrayObject::STD_PROP_LIST); } } class D extends ArrayObject { public function __construct ($input = array()) { parent::__construct($input, ArrayObject::STD_PROP_LIST); } } class E extends ArrayObject { public function __construct ($input = array()) { parent::__construct($input, ArrayObject::ARRAY_AS_PROPS); } } $input = array('public' => 'test', 'private' => 'test', 'protected' => 'test'); $os = array( 'a' => new A($input), 'b' => new B($input), 'c' => new C($input), 'd' => new D($input), 'e' => new E($input), ); foreach($os as $n => $o) { echo str_repeat('=', 60), "\n"; echo "$n\n"; var_dump($o); var_dump($o->public); echo "\n"; echo str_repeat('=', 60), "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 49
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 49
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/8dsar
function name:  (null)
number of ops:  51
compiled vars:  !0 = $input, !1 = $os, !2 = $o, !3 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   ASSIGN                                                   !0, <array>
   54     1        NEW                                              $5      'A'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        INIT_ARRAY                                       ~7      $5, 'a'
   55     5        NEW                                              $8      'B'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8        ADD_ARRAY_ELEMENT                                ~7      $8, 'b'
   56     9        NEW                                              $10     'C'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
         12        ADD_ARRAY_ELEMENT                                ~7      $10, 'c'
   57    13        NEW                                              $12     'D'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
         16        ADD_ARRAY_ELEMENT                                ~7      $12, 'd'
   58    17        NEW                                              $14     'E'
         18        SEND_VAR_EX                                              !0
         19        DO_FCALL                                      0          
         20        ADD_ARRAY_ELEMENT                                ~7      $14, 'e'
   53    21        ASSIGN                                                   !1, ~7
   61    22      > FE_RESET_R                                       $17     !1, ->49
         23    > > FE_FETCH_R                                       ~18     $17, !2, ->49
         24    >   ASSIGN                                                   !3, ~18
   62    25        INIT_FCALL                                               'str_repeat'
         26        SEND_VAL                                                 '%3D'
         27        SEND_VAL                                                 60
         28        DO_ICALL                                         $20     
         29        ECHO                                                     $20
         30        ECHO                                                     '%0A'
   63    31        NOP                                                      
         32        FAST_CONCAT                                      ~21     !3, '%0A'
         33        ECHO                                                     ~21
   64    34        INIT_FCALL                                               'var_dump'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                                 
   65    37        INIT_FCALL                                               'var_dump'
         38        FETCH_OBJ_R                                      ~23     !2, 'public'
         39        SEND_VAL                                                 ~23
         40        DO_ICALL                                                 
   66    41        ECHO                                                     '%0A'
   67    42        INIT_FCALL                                               'str_repeat'
         43        SEND_VAL                                                 '%3D'
         44        SEND_VAL                                                 60
         45        DO_ICALL                                         $25     
         46        ECHO                                                     $25
         47        ECHO                                                     '%0A'
   61    48      > JMP                                                      ->23
         49    >   FE_FREE                                                  $17
   68    50      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dsar
function name:  __construct
number of ops:  6
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_INIT                                        !0      <array>
   10     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              2
          4        DO_FCALL                                      0          
   11     5      > RETURN                                                   null

End of function __construct

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dsar
function name:  __construct
number of ops:  2
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV_INIT                                        !0      <array>
   22     1      > RETURN                                                   null

End of function __construct

End of class B.

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dsar
function name:  __construct
number of ops:  6
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV_INIT                                        !0      <array>
   32     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              1
          4        DO_FCALL                                      0          
   33     5      > RETURN                                                   null

End of function __construct

End of class C.

Class D:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dsar
function name:  __construct
number of ops:  6
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV_INIT                                        !0      <array>
   40     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              1
          4        DO_FCALL                                      0          
   41     5      > RETURN                                                   null

End of function __construct

End of class D.

Class E:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dsar
function name:  __construct
number of ops:  6
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   RECV_INIT                                        !0      <array>
   48     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              2
          4        DO_FCALL                                      0          
   49     5      > RETURN                                                   null

End of function __construct

End of class E.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.83 ms | 1404 KiB | 17 Q