3v4l.org

run code in 500+ PHP versions simultaneously
<?php class test implements ArrayAccess { public $v; function __construct() { $this->v = array( 'a' => array('b' => 'c'), 'd' => array('e' => 'f'), 'g' => array('h' => 'i') ); } function offsetExists($offset) { return isset($this->v); } function &offsetGet($offset) { $null = null; if (isset($this->v[$offset])) { return $this->v[$offset]; } return $null; } function offsetSet($offset, $value) { if (is_null($offset)) { $this->v[] = $value; } else { $this->v[$offset] = $value; } } function offsetUnset($offset) { unset($this->v[$offset]); } } $test = new test(); $test['a']['b'] = 'zzz'; print_r($test->v);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jGMN
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                                'test'
   45     1        NEW                                                  $1      'test'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   46     4        FETCH_DIM_W                                          $4      !0, 'a'
          5        ASSIGN_DIM                                                   $4, 'b'
          6        OP_DATA                                                      'zzz'
   48     7        INIT_FCALL                                                   'print_r'
          8        FETCH_OBJ_R                                          ~6      !0, 'v'
          9        SEND_VAL                                                     ~6
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jGMN
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                                   'v'
   10     1        OP_DATA                                                      <array>
   14     2      > RETURN                                                       null

End of function __construct

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jGMN
function name:  offsetExists
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
   18     1        ISSET_ISEMPTY_PROP_OBJ                               ~1      'v'
          2      > RETURN                                                       ~1
   19     3*     > RETURN                                                       null

End of function offsetexists

Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
Return found
Branch analysis from position: 8
Return found
filename:       /in/4jGMN
function name:  offsetGet
number of ops:  10
compiled vars:  !0 = $offset, !1 = $null
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   RECV                                                 !0      
   23     1        ASSIGN                                                       !1, null
   24     2        FETCH_OBJ_IS                                         ~3      'v'
          3        ISSET_ISEMPTY_DIM_OBJ                             0          ~3, !0
          4      > JMPZ                                                         ~4, ->8
   25     5    >   FETCH_OBJ_W                                          $5      'v'
          6        FETCH_DIM_W                                          $6      $5, !0
          7      > RETURN_BY_REF                                                $6
   27     8    > > RETURN_BY_REF                                                !1
   28     9*     > RETURN_BY_REF                                                null

End of function offsetget

Function offsetset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jGMN
function name:  offsetSet
number of ops:  12
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   32     2        TYPE_CHECK                                        2          !0
          3      > JMPZ                                                         ~2, ->8
   33     4    >   FETCH_OBJ_W                                          $3      'v'
          5        ASSIGN_DIM                                                   $3
          6        OP_DATA                                                      !1
   32     7      > JMP                                                          ->11
   35     8    >   FETCH_OBJ_W                                          $5      'v'
          9        ASSIGN_DIM                                                   $5, !0
         10        OP_DATA                                                      !1
   37    11    > > RETURN                                                       null

End of function offsetset

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jGMN
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   39     0  E >   RECV                                                 !0      
   41     1        FETCH_OBJ_UNSET                                      $1      'v'
          2        UNSET_DIM                                                    $1, !0
   42     3      > RETURN                                                       null

End of function offsetunset

End of class test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.67 ms | 2524 KiB | 14 Q