3v4l.org

run code in 300+ PHP versions simultaneously
<?php class O implements ArrayAccess { public function offsetSet($key, $value) { $this->data[$key] = $value; } public function offsetExists($key) { return isset($this->data[$key]); } public function offsetUnset($key) { unset($this->data[$key]); } public function offsetGet($key) { return $this->data[$key]; } } $o = new O; $o['foo'] = 'bar'; var_dump(array_key_exists('foo', $o)); var_dump(array_key_exists('bar', $o));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OCUqa
function name:  (null)
number of ops:  15
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'o'
    9     1        NEW                                              $1      'O'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   10     4        ASSIGN_DIM                                               !0, 'foo'
          5        OP_DATA                                                  'bar'
   11     6        INIT_FCALL                                               'var_dump'
          7        ARRAY_KEY_EXISTS                                 ~5      'foo', !0
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
   12    10        INIT_FCALL                                               'var_dump'
         11        ARRAY_KEY_EXISTS                                 ~7      'bar', !0
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class O:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OCUqa
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_OBJ_W                                      $2      'data'
          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/OCUqa
function name:  offsetExists
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        FETCH_OBJ_IS                                     ~1      'data'
          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/OCUqa
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        FETCH_OBJ_UNSET                                  $1      'data'
          2        UNSET_DIM                                                $1, !0
          3      > RETURN                                                   null

End of function offsetunset

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OCUqa
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_R                                      ~1      'data'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function offsetget

End of class O.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.56 ms | 1400 KiB | 15 Q