3v4l.org

run code in 500+ 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)) { $this[$index] = null; } return $this[$index]; } } $test = new Thing([]); $test->dynamic['key'] = ['is-set' => 'up to 7.1.3']; var_dump($test);

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZofH7
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   NEW                                                  $1      'Thing'
          1        SEND_VAL_EX                                                  <array>
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   24     4        FETCH_OBJ_W                                          $4      !0, 'dynamic'
          5        ASSIGN_DIM                                                   $4, 'key'
          6        OP_DATA                                                      <array>
   26     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/ZofH7
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/ZofH7
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 = 6, Position 2 = 9
Branch analysis from position: 6
Return found
Branch analysis from position: 9
filename:       /in/ZofH7
function name:  offsetGet
number of ops:  13
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        BOOL_NOT                                             ~2      $1
          5      > JMPZ                                                         ~2, ->9
   17     6    >   FETCH_THIS                                           $3      
          7        ASSIGN_DIM                                                   $3, !0
          8        OP_DATA                                                      null
   19     9    >   FETCH_THIS                                           $5      
         10        FETCH_DIM_W                                          $6      $5, !0
         11      > RETURN_BY_REF                                                $6
   20    12*     > RETURN_BY_REF                                                null

End of function offsetget

End of class Thing.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.51 ms | 2316 KiB | 14 Q