3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x extends arrayobject{ protected $a = 'protected'; public $b = 'public'; public function __construct(){ parent::__construct(['a'=>'A', 'b'=>'B'], ARRAY_AS_PROPS); } } $a = new x; echo $a->b; echo $a->a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D61YI
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        FETCH_OBJ_R                                      ~4      !0, 'b'
          4        ECHO                                                     ~4
   13     5        FETCH_OBJ_R                                      ~5      !0, 'a'
          6        ECHO                                                     ~5
          7      > RETURN                                                   1

Class x:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D61YI
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        SEND_VAL_EX                                              <array>
          2        FETCH_CONSTANT                                   ~0      'ARRAY_AS_PROPS'
          3        SEND_VAL_EX                                              ~0
          4        DO_FCALL                                      0          
    8     5      > RETURN                                                   null

End of function __construct

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.36 ms | 1393 KiB | 13 Q