3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyArrayObject extends ArrayObject{ function __construct($input=[]){ parent::__construct($input,ArrayObject::ARRAY_AS_PROPS); } function offsetSet($x,$v){ echo "offsetSet('{$x}')\n"; return parent::offsetSet($x,$v); } function offsetGet($x){ echo "offsetGet('{$x}')\n"; return parent::offsetGet($x); } function __get($x){ echo "__get('{$x}')\n"; } function __set($x,$v){ echo "__set('{$x}')\n"; } function offsetExists($x){ echo "offsetExists('{$x}')\n"; return parent::offsetExists($x); } } $x=new MyArrayObject; $x->hello=5; $x['hi']=10; $x['hello']++; @$x->a->b=7; $x->a->b++;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJH6M
function name:  (null)
number of ops:  17
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   NEW                                                  $1      'MyArrayObject'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   26     3        ASSIGN_OBJ                                                   !0, 'hello'
          4        OP_DATA                                                      5
   27     5        ASSIGN_DIM                                                   !0, 'hi'
          6        OP_DATA                                                      10
   28     7        FETCH_DIM_RW                                         $6      !0, 'hello'
          8        PRE_INC                                                      $6
   29     9        BEGIN_SILENCE                                        ~8      
         10        FETCH_OBJ_W                                          $9      !0, 'a'
         11        ASSIGN_OBJ                                                   $9, 'b'
         12        OP_DATA                                                      7
         13        END_SILENCE                                                  ~8
   30    14        FETCH_OBJ_RW                                         $11     !0, 'a'
         15        PRE_INC_OBJ                                                  $11, 'b'
         16      > RETURN                                                       1

Class MyArrayObject:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJH6M
function name:  __construct
number of ops:  6
compiled vars:  !0 = $input
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                            !0      <array>
    4     1        INIT_STATIC_METHOD_CALL                                      
          2        SEND_VAR_EX                                                  !0
          3        SEND_VAL_EX                                                  2
          4        DO_FCALL                                          0          
    5     5      > RETURN                                                       null

End of function __construct

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJH6M
function name:  offsetSet
number of ops:  12
compiled vars:  !0 = $x, !1 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    7     2        ROPE_INIT                                         3  ~3      'offsetSet%28%27'
          3        ROPE_ADD                                          1  ~3      ~3, !0
          4        ROPE_END                                          2  ~2      ~3, '%27%29%0A'
          5        ECHO                                                         ~2
    8     6        INIT_STATIC_METHOD_CALL                                      'offsetSet'
          7        SEND_VAR_EX                                                  !0
          8        SEND_VAR_EX                                                  !1
          9        DO_FCALL                                          0  $5      
         10      > RETURN                                                       $5
    9    11*     > RETURN                                                       null

End of function offsetset

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJH6M
function name:  offsetGet
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        ROPE_INIT                                         3  ~2      'offsetGet%28%27'
          2        ROPE_ADD                                          1  ~2      ~2, !0
          3        ROPE_END                                          2  ~1      ~2, '%27%29%0A'
          4        ECHO                                                         ~1
   12     5        INIT_STATIC_METHOD_CALL                                      'offsetGet'
          6        SEND_VAR_EX                                                  !0
          7        DO_FCALL                                          0  $4      
          8      > RETURN                                                       $4
   13     9*     > RETURN                                                       null

End of function offsetget

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJH6M
function name:  __get
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   15     1        ROPE_INIT                                         3  ~2      '__get%28%27'
          2        ROPE_ADD                                          1  ~2      ~2, !0
          3        ROPE_END                                          2  ~1      ~2, '%27%29%0A'
          4        ECHO                                                         ~1
   16     5      > RETURN                                                       null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJH6M
function name:  __set
number of ops:  7
compiled vars:  !0 = $x, !1 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   18     2        ROPE_INIT                                         3  ~3      '__set%28%27'
          3        ROPE_ADD                                          1  ~3      ~3, !0
          4        ROPE_END                                          2  ~2      ~3, '%27%29%0A'
          5        ECHO                                                         ~2
   19     6      > RETURN                                                       null

End of function __set

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJH6M
function name:  offsetExists
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
   21     1        ROPE_INIT                                         3  ~2      'offsetExists%28%27'
          2        ROPE_ADD                                          1  ~2      ~2, !0
          3        ROPE_END                                          2  ~1      ~2, '%27%29%0A'
          4        ECHO                                                         ~1
   22     5        INIT_STATIC_METHOD_CALL                                      'offsetExists'
          6        SEND_VAR_EX                                                  !0
          7        DO_FCALL                                          0  $4      
          8      > RETURN                                                       $4
   23     9*     > RETURN                                                       null

End of function offsetexists

End of class MyArrayObject.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
150.91 ms | 2208 KiB | 8 Q