3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ObjArray implements ArrayAccess { private $data; public function offsetSet($key, $value) { var_dump($key, $value); $this->data[$key] = $value; } public function offsetGet($key) { return $this->data[$key]; } public function offsetUnset($key) { unset($this->data[$key]); } public function offsetExists($key) { return isset($this->data[$key]); } } $arr = new ObjArray; $arr[0] = 1; $arr[] = 2;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1rIlB
function name:  (null)
number of ops:  9
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'objarray'
   29     1        NEW                                              $1      'ObjArray'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   30     4        ASSIGN_DIM                                               !0, 0
          5        OP_DATA                                                  1
   31     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  2
          8      > RETURN                                                   1

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

End of function offsetset

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1rIlB
function name:  offsetGet
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        FETCH_OBJ_R                                      ~1      'data'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   16     4*     > RETURN                                                   null

End of function offsetget

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

End of function offsetunset

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

End of function offsetexists

End of class ObjArray.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.32 ms | 1400 KiB | 15 Q