3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing extends ArrayObject { public function __construct(array $data) { parent::__construct($data, self::ARRAY_AS_PROPS); } public function offsetSet($index, $value) { parent::offsetSet($index, $value); return $this; } public function offsetGet($index) { if ($this->offsetExists($index)) { return parent::offsetGet($index); } return null; } } $test = new Thing([]); $test->dynamic['key'] = ['is-set' => 'up to 7.1.3']; var_dump($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQdPJ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'Thing'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   25     4        FETCH_OBJ_W                                      $4      !0, 'dynamic'
          5        ASSIGN_DIM                                               $4, 'key'
          6        OP_DATA                                                  <array>
   27     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function __construct

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQdPJ
function name:  offsetSet
number of ops:  9
compiled vars:  !0 = $index, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        INIT_STATIC_METHOD_CALL                                  'offsetSet'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   12     6        FETCH_THIS                                       ~3      
          7      > RETURN                                                   ~3
   13     8*     > RETURN                                                   null

End of function offsetset

Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQdPJ
function name:  offsetGet
number of ops:  11
compiled vars:  !0 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_METHOD_CALL                                         'offsetExists'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > JMPZ                                                     $1, ->9
   17     5    >   INIT_STATIC_METHOD_CALL                                  'offsetGet'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $2      
          8      > RETURN                                                   $2
   20     9    > > RETURN                                                   null
   21    10*     > RETURN                                                   null

End of function offsetget

End of class Thing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.4 ms | 1400 KiB | 15 Q