3v4l.org

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

Class M:
Function _construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3s0C9
function name:  _construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN_OBJ                                               'arr'
          1        OP_DATA                                                  <array>
          2      > RETURN                                                   null

End of function _construct

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

End of function offsetexists

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3s0C9
function name:  offsetGet
number of ops:  5
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        FETCH_OBJ_R                                      ~1      'arr'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   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/3s0C9
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_OBJ_W                                      $2      'arr'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
          5      > 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/3s0C9
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        FETCH_OBJ_UNSET                                  $1      'arr'
          2        UNSET_DIM                                                $1, !0
          3      > RETURN                                                   null

End of function offsetunset

End of class M.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.65 ms | 1400 KiB | 15 Q