3v4l.org

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

Class X:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6bGXS
function name:  offsetGet
number of ops:  7
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        INIT_FCALL_BY_NAME                                       'va_dump'
          2        SEND_VAL_EX                                              0
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   '42'
          6*     > 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/6bGXS
function name:  offsetSet
number of ops:  7
compiled vars:  !0 = $x, !1 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                                 
          6      > RETURN                                                   null

End of function offsetset

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.25 ms | 1395 KiB | 15 Q