3v4l.org

run code in 500+ PHP versions simultaneously
<?php error_reporting(E_ALL); class RefArray implements ArrayAccess { public $array; public function &offsetGet($key) { return $this->array[$key]; } public function offsetSet($key, $value) { $this->array[$key] = $value; } public function offsetExists($key) { return isset($this->array[$key]); } public function offsetUnset($key) { unset($this->array[$key]); } } $arr = new RefArray; $arr[0] = 'abc'; $arr[1] =& $arr[0];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ggHJm
function name:  (null)
number of ops:  14
compiled vars:  !0 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     30719
          2        DO_ICALL                                                     
    3     3        DECLARE_CLASS                                                'refarray'
   11     4        NEW                                                  $2      'RefArray'
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !0, $2
   12     7        ASSIGN_DIM                                                   !0, 0
          8        OP_DATA                                                      'abc'
   13     9        FETCH_DIM_W                                          $7      !0, 0
         10        MAKE_REF                                             $8      $7
         11        FETCH_DIM_W                                          $6      !0, 1
         12        ASSIGN_REF                                                   $6, $8
         13      > RETURN                                                       1

Class RefArray:
Function offsetget:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/ggHJm
function name:  offsetGet
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        FETCH_OBJ_W                                          $1      'array'
          2        FETCH_DIM_W                                          $2      $1, !0
          3      > RETURN_BY_REF                                                $2
          4*     > RETURN_BY_REF                                                null

End of function offsetget

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ggHJm
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        FETCH_OBJ_W                                          $2      'array'
          3        ASSIGN_DIM                                                   $2, !0
          4        OP_DATA                                                      !1
          5      > RETURN                                                       null

End of function offsetset

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ggHJm
function name:  offsetExists
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        FETCH_OBJ_IS                                         ~1      'array'
          2        ISSET_ISEMPTY_DIM_OBJ                             0  ~2      ~1, !0
          3      > RETURN                                                       ~2
          4*     > RETURN                                                       null

End of function offsetexists

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

End of function offsetunset

End of class RefArray.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
129.62 ms | 482 KiB | 8 Q