3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AA implements ArrayAccess { public function offsetSet($offset, $value) { echo "set $offset = $value\n"; } public function offsetExists($offset) { } public function offsetUnset($offset) { } public function offsetGet($offset) { } public function f() { return $this; } } class Di { public $aa; public function __construct() { $this->aa = new AA(); $this->aa->in = $this->aa; $this->aa->out = $this->aa; } } $di = new Di(); $di->aa->in->in->out->out->in['test'] = 123; $di->aa->f()['fff'] = 'aaa';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HBedp
function name:  (null)
number of ops:  19
compiled vars:  !0 = $di
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'aa'
   30     1        NEW                                              $1      'Di'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   31     4        FETCH_OBJ_W                                      $4      !0, 'aa'
          5        FETCH_OBJ_W                                      $5      $4, 'in'
          6        FETCH_OBJ_W                                      $6      $5, 'in'
          7        FETCH_OBJ_W                                      $7      $6, 'out'
          8        FETCH_OBJ_W                                      $8      $7, 'out'
          9        FETCH_OBJ_W                                      $9      $8, 'in'
         10        ASSIGN_DIM                                               $9, 'test'
         11        OP_DATA                                                  123
   32    12        FETCH_OBJ_R                                      ~11     !0, 'aa'
         13        INIT_METHOD_CALL                                         ~11, 'f'
         14        DO_FCALL                                      0  $12     
         15        SEPARATE                                         $12     $12
         16        ASSIGN_DIM                                               $12, 'fff'
         17        OP_DATA                                                  'aaa'
         18      > RETURN                                                   1

Class AA:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HBedp
function name:  offsetSet
number of ops:  9
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ROPE_INIT                                     5  ~3      'set+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '+%3D+'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '%0A'
          7        ECHO                                                     ~2
    5     8      > 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/HBedp
function name:  offsetExists
number of ops:  2
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     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/HBedp
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1      > RETURN                                                   null

End of function offsetunset

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

End of function offsetget

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HBedp
function name:  f
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function f

End of class AA.

Class Di:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HBedp
function name:  __construct
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'AA'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'aa'
          3        OP_DATA                                                  $1
   25     4        FETCH_OBJ_R                                      ~5      'aa'
          5        FETCH_OBJ_W                                      $3      'aa'
          6        ASSIGN_OBJ                                               $3, 'in'
          7        OP_DATA                                                  ~5
   26     8        FETCH_OBJ_R                                      ~8      'aa'
          9        FETCH_OBJ_W                                      $6      'aa'
         10        ASSIGN_OBJ                                               $6, 'out'
         11        OP_DATA                                                  ~8
   27    12      > RETURN                                                   null

End of function __construct

End of class Di.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.37 ms | 1399 KiB | 13 Q