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(); function id($k) { return $k; } var_dump($x[id('123')]); var_dump($x[id('123')] = 4); var_dump(isset($x[id('123')])); unset($x[id('123')]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NSY4d
function name:  (null)
number of ops:  31
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'c'
   20     1        NEW                                              $1      'C'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'id'
          6        SEND_VAL                                                 '123'
          7        DO_FCALL                                      0  $4      
          8        FETCH_DIM_R                                      ~5      !0, $4
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
   23    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'id'
         13        SEND_VAL                                                 '123'
         14        DO_FCALL                                      0  $7      
         15        ASSIGN_DIM                                       ~8      !0, $7
         16        OP_DATA                                                  4
         17        SEND_VAL                                                 ~8
         18        DO_ICALL                                                 
   24    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'id'
         21        SEND_VAL                                                 '123'
         22        DO_FCALL                                      0  $10     
         23        ISSET_ISEMPTY_DIM_OBJ                         0  ~11     !0, $10
         24        SEND_VAL                                                 ~11
         25        DO_ICALL                                                 
   25    26        INIT_FCALL                                               'id'
         27        SEND_VAL                                                 '123'
         28        DO_FCALL                                      0  $13     
         29        UNSET_DIM                                                !0, $13
         30      > RETURN                                                   1

Function id:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NSY4d
function name:  id
number of ops:  3
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function id

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