3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X extends ArrayObject{ public function offsetSet($key, $val){ echo "offsetSet called \n"; parent::offsetSet($key, $val); } } $arr = new X([]); $arr->append('val'); $arr->offsetSet(5, 'val');print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8TQVJ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'X'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   11     4        INIT_METHOD_CALL                                         !0, 'append'
          5        SEND_VAL_EX                                              'val'
          6        DO_FCALL                                      0          
   12     7        INIT_METHOD_CALL                                         !0, 'offsetSet'
          8        SEND_VAL_EX                                              5
          9        SEND_VAL_EX                                              'val'
         10        DO_FCALL                                      0          
         11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class X:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8TQVJ
function name:  offsetSet
number of ops:  8
compiled vars:  !0 = $key, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ECHO                                                     'offsetSet+called+%0A'
    6     3        INIT_STATIC_METHOD_CALL                                  'offsetSet'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
    7     7      > RETURN                                                   null

End of function offsetset

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.43 ms | 1387 KiB | 15 Q