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/FMoq2
function name:  (null)
number of ops:  28
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        BEGIN_SILENCE                                    ~6      
          7        END_SILENCE                                              ~6
          8        FETCH_DIM_R                                      ~7      !0, 123
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                                 
   23    11        INIT_FCALL                                               'var_dump'
         12        BEGIN_SILENCE                                    ~9      
         13        END_SILENCE                                              ~9
         14        ASSIGN_DIM                                       ~10     !0, 123
         15        OP_DATA                                                  4
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                                 
   24    18        INIT_FCALL                                               'var_dump'
         19        BEGIN_SILENCE                                    ~12     
         20        END_SILENCE                                              ~12
         21        ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !0, 123
         22        SEND_VAL                                                 ~13
         23        DO_ICALL                                                 
   25    24        BEGIN_SILENCE                                    ~15     
         25        END_SILENCE                                              ~15
         26        UNSET_DIM                                                !0, 123
         27      > RETURN                                                   1

Class C:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FMoq2
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/FMoq2
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/FMoq2
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/FMoq2
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:
153.38 ms | 1400 KiB | 15 Q