3v4l.org

run code in 300+ 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) { return isset($this->var[$offset]) ? $this->var[$offset] : ($null =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/GPahg
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'
   41     1        NEW                                              $1      'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   42     4        FETCH_DIM_W                                      $4      !0, 'a'
          5        ASSIGN_DIM                                               $4, 'b'
          6        OP_DATA                                                  'zzz'
   44     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/GPahg
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/GPahg
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 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Return found
Branch analysis from position: 8
Return found
filename:       /in/GPahg
function name:  offsetGet
number of ops:  12
compiled vars:  !0 = $offset, !1 = $null
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        FETCH_OBJ_IS                                     ~2      'var'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, !0
          3      > JMPZ                                                     ~3, ->8
          4    >   FETCH_OBJ_R                                      ~4      'var'
          5        FETCH_DIM_R                                      ~5      ~4, !0
          6        QM_ASSIGN                                        ~6      ~5
          7      > JMP                                                      ->10
          8    >   ASSIGN                                           ~7      !1, null
          9        QM_ASSIGN                                        ~6      ~7
         10    > > RETURN_BY_REF                                            ~6
   24    11*     > 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/GPahg
function name:  offsetSet
number of ops:  12
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   28     2        TYPE_CHECK                                    2          !0
          3      > JMPZ                                                     ~2, ->8
   29     4    >   FETCH_OBJ_W                                      $3      'v'
          5        ASSIGN_DIM                                               $3
          6        OP_DATA                                                  !1
          7      > JMP                                                      ->11
   31     8    >   FETCH_OBJ_W                                      $5      'v'
          9        ASSIGN_DIM                                               $5, !0
         10        OP_DATA                                                  !1
   33    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/GPahg
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   37     1        FETCH_OBJ_UNSET                                  $1      'v'
          2        UNSET_DIM                                                $1, !0
   38     3      > RETURN                                                   null

End of function offsetunset

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.73 ms | 1400 KiB | 15 Q