3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a implements ArrayAccess { public $state = 0; public function offsetGet($d) { return $this->state++; } public function offsetSet($d,$v) {} public function offsetUnset($d) {} public function offsetExists($d) {return true;} } list($a,$b,$c) = new a; var_dump($a,$b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UjrLf
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
   12     1        NEW                                              $3      'a'
          2        DO_FCALL                                      0          
          3        FETCH_LIST_R                                     $5      $3, 0
          4        ASSIGN                                                   !0, $5
          5        FETCH_LIST_R                                     $7      $3, 1
          6        ASSIGN                                                   !1, $7
          7        FETCH_LIST_R                                     $9      $3, 2
          8        ASSIGN                                                   !2, $9
          9        FREE                                                     $3
   13    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class a:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UjrLf
function name:  offsetGet
number of ops:  4
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        POST_INC_OBJ                                     ~1      'state'
          2      > RETURN                                                   ~1
    7     3*     > 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/UjrLf
function name:  offsetSet
number of ops:  3
compiled vars:  !0 = $d, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function offsetset

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

End of function offsetunset

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UjrLf
function name:  offsetExists
number of ops:  3
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1      > RETURN                                                   <true>
          2*     > RETURN                                                   null

End of function offsetexists

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.88 ms | 1405 KiB | 15 Q