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); } } $input = array('public' => 'test', 'private' => 'test', 'protected' => 'test'); $os = array( 'a' => new A($input), 'b' => new B($input), 'c' => new C($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 = 15, Position 2 = 41
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 41
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/67eXu
function name:  (null)
number of ops:  43
compiled vars:  !0 = $input, !1 = $os, !2 = $o, !3 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   ASSIGN                                                   !0, <array>
   38     1        NEW                                              $5      'A'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        INIT_ARRAY                                       ~7      $5, 'a'
   39     5        NEW                                              $8      'B'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8        ADD_ARRAY_ELEMENT                                ~7      $8, 'b'
   40     9        NEW                                              $10     'C'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
         12        ADD_ARRAY_ELEMENT                                ~7      $10, 'c'
   37    13        ASSIGN                                                   !1, ~7
   43    14      > FE_RESET_R                                       $13     !1, ->41
         15    > > FE_FETCH_R                                       ~14     $13, !2, ->41
         16    >   ASSIGN                                                   !3, ~14
   44    17        INIT_FCALL                                               'str_repeat'
         18        SEND_VAL                                                 '%3D'
         19        SEND_VAL                                                 60
         20        DO_ICALL                                         $16     
         21        ECHO                                                     $16
         22        ECHO                                                     '%0A'
   45    23        NOP                                                      
         24        FAST_CONCAT                                      ~17     !3, '%0A'
         25        ECHO                                                     ~17
   46    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
   47    29        INIT_FCALL                                               'var_dump'
         30        FETCH_OBJ_R                                      ~19     !2, 'public'
         31        SEND_VAL                                                 ~19
         32        DO_ICALL                                                 
   48    33        ECHO                                                     '%0A'
   49    34        INIT_FCALL                                               'str_repeat'
         35        SEND_VAL                                                 '%3D'
         36        SEND_VAL                                                 60
         37        DO_ICALL                                         $21     
         38        ECHO                                                     $21
         39        ECHO                                                     '%0A'
   43    40      > JMP                                                      ->15
         41    >   FE_FREE                                                  $13
   50    42      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/67eXu
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/67eXu
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/67eXu
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.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.12 ms | 1400 KiB | 17 Q