3v4l.org

run code in 300+ 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/k6hMe
function name:  (null)
number of ops:  14
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    4     3        DECLARE_CLASS                                            'refarray'
   12     4        NEW                                              $2      'RefArray'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   13     7        ASSIGN_DIM                                               !0, 0
          8        OP_DATA                                                  'abc'
   14     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/k6hMe
function name:  offsetGet
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     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/k6hMe
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     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/k6hMe
function name:  offsetExists
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     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/k6hMe
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     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.0.0


preferences:
145.93 ms | 1405 KiB | 15 Q