3v4l.org

run code in 300+ PHP versions simultaneously
<?php class App_Collection implements ArrayAccess, IteratorAggregate, Countable { public $data = array('x'=>'a'); public function count() { return count($this->data); } public function offsetExists($offset) { return isset($this->data[$offset]) || array_key_exists($offset, $this->data); } public function offsetGet($offset) { if ($this->offsetExists($offset)) { return $this->data[$offset]; } return false; } public function offsetSet($offset, $value) { if ($offset) { $this->data[$offset] = $value; } else { $this->data[] = $value; } } public function offsetUnset($offset) { unset($this->data[$offset]); } public function getIterator() { return new ArrayIterator($this->data); } } $array = new App_Collection(); var_dump(isset($array['x'])); var_dump(array_key_exists('x', $array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FRs5K
function name:  (null)
number of ops:  13
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'app_collection'
   47     1        NEW                                              $1      'App_Collection'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   49     4        INIT_FCALL                                               'var_dump'
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      !0, 'x'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   50     8        INIT_FCALL                                               'var_dump'
          9        ARRAY_KEY_EXISTS                                 ~6      'x', !0
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class App_Collection:
Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FRs5K
function name:  count
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        COUNT                                            ~1      ~0
          2      > RETURN                                                   ~1
    9     3*     > RETURN                                                   null

End of function count

Function offsetexists:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/FRs5K
function name:  offsetExists
number of ops:  9
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_IS                                     ~1      'data'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          3      > JMPNZ_EX                                         ~2      ~2, ->7
          4    >   FETCH_OBJ_R                                      ~3      'data'
          5        ARRAY_KEY_EXISTS                                 ~4      !0, ~3
          6        BOOL                                             ~2      ~4
          7    > > RETURN                                                   ~2
   14     8*     > RETURN                                                   null

End of function offsetexists

Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FRs5K
function name:  offsetGet
number of ops:  10
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        INIT_METHOD_CALL                                         'offsetExists'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > JMPZ                                                     $1, ->8
   20     5    >   FETCH_OBJ_R                                      ~2      'data'
          6        FETCH_DIM_R                                      ~3      ~2, !0
          7      > RETURN                                                   ~3
   22     8    > > RETURN                                                   <false>
   23     9*     > RETURN                                                   null

End of function offsetget

Function offsetset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FRs5K
function name:  offsetSet
number of ops:  11
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   27     2      > JMPZ                                                     !0, ->7
   29     3    >   FETCH_OBJ_W                                      $2      'data'
          4        ASSIGN_DIM                                               $2, !0
          5        OP_DATA                                                  !1
          6      > JMP                                                      ->10
   33     7    >   FETCH_OBJ_W                                      $4      'data'
          8        ASSIGN_DIM                                               $4
          9        OP_DATA                                                  !1
   35    10    > > 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/FRs5K
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
   39     1        FETCH_OBJ_UNSET                                  $1      'data'
          2        UNSET_DIM                                                $1, !0
   40     3      > RETURN                                                   null

End of function offsetunset

Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FRs5K
function name:  getIterator
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   NEW                                              $0      'ArrayIterator'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $1      'data'
          3        SEND_FUNC_ARG                                            $1
          4        DO_FCALL                                      0          
          5      > RETURN                                                   $0
   45     6*     > RETURN                                                   null

End of function getiterator

End of class App_Collection.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.34 ms | 1404 KiB | 15 Q