3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExtendedArrayAccess implements ArrayAccess { private $data = array(); function __construct(array $array = array()) { $this->data = $array; } function offsetExists($offset) { return isset($this->data[$offset]); } function offsetGet($offset) { return $this->data[$offset]; } function offsetSet($offset, $value) { $this->data[$offset] = $value; } function offsetUnset($offset) { unset($this->data[$offset]); } } $array = new ExtendedArrayAccess(); $array[0] = null; assert(isset($array[0]) === false); assert(empty($array[0]) === true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cob8B
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'extendedarrayaccess'
   22     1        NEW                                              $1      'ExtendedArrayAccess'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   23     4        ASSIGN_DIM                                               !0, 0
          5        OP_DATA                                                  null
   24     6        ASSERT_CHECK                                             
          7        INIT_FCALL                                               'assert'
          8        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      !0, 0
          9        TYPE_CHECK                                    4  ~6      ~5
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 'assert%28isset%28%24array%5B0%5D%29+%3D%3D%3D+false%29'
         12        DO_ICALL                                                 
   25    13        ASSERT_CHECK                                             
         14        INIT_FCALL                                               'assert'
         15        ISSET_ISEMPTY_DIM_OBJ                         1  ~8      !0, 0
         16        TYPE_CHECK                                    8  ~9      ~8
         17        SEND_VAL                                                 ~9
         18        SEND_VAL                                                 'assert%28empty%28%24array%5B0%5D%29+%3D%3D%3D+true%29'
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class ExtendedArrayAccess:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cob8B
function name:  __construct
number of ops:  4
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <array>
    6     1        ASSIGN_OBJ                                               'data'
          2        OP_DATA                                                  !0
    7     3      > 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/cob8B
function name:  offsetExists
number of ops:  5
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        FETCH_OBJ_IS                                     ~1      'data'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          3      > RETURN                                                   ~2
   10     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/cob8B
function name:  offsetGet
number of ops:  5
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        FETCH_OBJ_R                                      ~1      'data'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   13     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/cob8B
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        FETCH_OBJ_W                                      $2      'data'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   16     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/cob8B
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        FETCH_OBJ_UNSET                                  $1      'data'
          2        UNSET_DIM                                                $1, !0
   19     3      > RETURN                                                   null

End of function offsetunset

End of class ExtendedArrayAccess.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.4 ms | 1400 KiB | 15 Q