3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X implements ArrayAccess { var $x = 42; function &offsetGet($n) { var_dump(0,$n); return $this->x;} function offsetSet($x, $z) { var_dump($x, $z); var_dump(1, $this->x); } function offsetExists($n) {} function offsetUnset($n) {} } $x = new X(); var_dump(++$x[23]); var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SSRka
function name:  (null)
number of ops:  13
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'x'
   10     1        NEW                                              $1      'X'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   11     4        INIT_FCALL                                               'var_dump'
          5        FETCH_DIM_RW                                     $4      !0, 23
          6        PRE_INC                                          ~5      $4
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
   12     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class X:
Function offsetget:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/SSRka
function name:  offsetGet
number of ops:  8
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 0
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
          5        FETCH_OBJ_W                                      $2      'x'
          6      > RETURN_BY_REF                                            $2
          7*     > RETURN_BY_REF                                            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/SSRka
function name:  offsetSet
number of ops:  12
compiled vars:  !0 = $x, !1 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                                 
          6        INIT_FCALL                                               'var_dump'
          7        SEND_VAL                                                 1
          8        FETCH_OBJ_R                                      ~3      'x'
          9        SEND_VAL                                                 ~3
         10        DO_ICALL                                                 
         11      > 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/SSRka
function name:  offsetExists
number of ops:  2
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1      > 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/SSRka
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function offsetunset

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.17 ms | 1400 KiB | 15 Q