3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C implements ArrayAccess { public function offsetGet($k) { echo "offsetGet: "; var_dump($k); } public function offsetSet($k, $v) { echo "offsetSet: "; var_dump($k); } public function offsetExists($k) { echo "offsetExists: "; var_dump($k); } public function offsetUnset($k) { echo "offsetUnset: "; var_dump($k); } } $x = new C(); $k = '123'; var_dump($x[('123')]); var_dump($x[('123')] = 4); var_dump(isset($x[('123')])); unset($x[('123')]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fkiqL
function name:  (null)
number of ops:  20
compiled vars:  !0 = $x, !1 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'c'
   20     1        NEW                                              $2      'C'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   21     4        ASSIGN                                                   !1, '123'
   22     5        INIT_FCALL                                               'var_dump'
          6        FETCH_DIM_R                                      ~6      !0, 123
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                                 
   23     9        INIT_FCALL                                               'var_dump'
         10        ASSIGN_DIM                                       ~8      !0, 123
         11        OP_DATA                                                  4
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                                 
   24    14        INIT_FCALL                                               'var_dump'
         15        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !0, 123
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                                 
   25    18        UNSET_DIM                                                !0, 123
         19      > RETURN                                                   1

Class C:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fkiqL
function name:  offsetGet
number of ops:  6
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     'offsetGet%3A+'
    5     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    6     5      > 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/fkiqL
function name:  offsetSet
number of ops:  7
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ECHO                                                     'offsetSet%3A+'
    9     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   10     6      > 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/fkiqL
function name:  offsetExists
number of ops:  6
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ECHO                                                     'offsetExists%3A+'
   13     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   14     5      > 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/fkiqL
function name:  offsetUnset
number of ops:  6
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ECHO                                                     'offsetUnset%3A+'
   17     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   18     5      > RETURN                                                   null

End of function offsetunset

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.2 ms | 1400 KiB | 15 Q