3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements ArrayAccess { public function offsetSet($offset, $value): void { var_dump(__METHOD__); } public function offsetGet($offset): mixed {} public function offsetUnset($offset): void {} public function offsetExists($offset): bool {} } class B extends ArrayObject { public function offsetSet($offset, $value): void { var_dump(__METHOD__); } } $a = new A(); $a[] = 1; $b = new B(); $b[] = 1;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lO4Tf
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
   14     1        NEW                                              $2      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   15     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  1
   17     6        NEW                                              $6      'B'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   18     9        ASSIGN_DIM                                               !1
         10        OP_DATA                                                  1
   19    11      > RETURN                                                   1

Class A:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lO4Tf
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'var_dump'
          3        SEND_VAL                                                 'A%3A%3AoffsetSet'
          4        DO_ICALL                                                 
          5      > 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/lO4Tf
function name:  offsetGet
number of ops:  3
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        VERIFY_RETURN_TYPE                                       
          2      > RETURN                                                   null

End of function offsetget

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lO4Tf
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     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/lO4Tf
function name:  offsetExists
number of ops:  3
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        VERIFY_RETURN_TYPE                                       
          2      > RETURN                                                   null

End of function offsetexists

End of class A.

Class B:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lO4Tf
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'var_dump'
          3        SEND_VAL                                                 'B%3A%3AoffsetSet'
          4        DO_ICALL                                                 
          5      > RETURN                                                   null

End of function offsetset

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.27 ms | 1005 KiB | 14 Q