3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements ArrayAccess { public function __get($k) { return 1; } public function __set($k, $v) { echo "__set($v)\n"; } public function offsetGet($k) { return 1; } public function offsetSet($k, $v) { echo "offsetSet($v)\n"; } public function offsetExists($k) {} public function offsetUnset($k) {} } $t = new Test; echo "Property:\n"; $t[0]++; echo "Offset:\n"; $t->x++;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ZZsT
function name:  (null)
number of ops:  10
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'test'
   21     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        ECHO                                                     'Property%3A%0A'
   23     5        FETCH_DIM_RW                                     $4      !0, 0
          6        PRE_INC                                                  $4
   24     7        ECHO                                                     'Offset%3A%0A'
   25     8        PRE_INC_OBJ                                              !0, 'x'
          9      > RETURN                                                   1

Class Test:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ZZsT
function name:  __get
number of ops:  3
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1      > RETURN                                                   1
    6     2*     > 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/1ZZsT
function name:  __set
number of ops:  7
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ROPE_INIT                                     3  ~3      '__set%28'
          3        ROPE_ADD                                      1  ~3      ~3, !1
          4        ROPE_END                                      2  ~2      ~3, '%29%0A'
          5        ECHO                                                     ~2
    9     6      > RETURN                                                   null

End of function __set

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ZZsT
function name:  offsetGet
number of ops:  3
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1      > RETURN                                                   1
   13     2*     > 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/1ZZsT
function name:  offsetSet
number of ops:  7
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ROPE_INIT                                     3  ~3      'offsetSet%28'
          3        ROPE_ADD                                      1  ~3      ~3, !1
          4        ROPE_END                                      2  ~2      ~3, '%29%0A'
          5        ECHO                                                     ~2
   16     6      > 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/1ZZsT
function name:  offsetExists
number of ops:  2
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     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/1ZZsT
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function offsetunset

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.02 ms | 1399 KiB | 13 Q