3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo implements ArrayAccess { public function offsetSet($offset, $value) { var_dump(__METHOD__); } public function offsetExists($var) { var_dump(__METHOD__); if ($var == "foobar") { return true; } return false; } public function offsetUnset($var) { var_dump(__METHOD__); } public function offsetGet($var) { var_dump(__METHOD__); return "value"; } } $foo = new foo(); $foo['bar'] = 1; var_dump(array_key_exists('bar', $foo));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQ3GO
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   24     1        NEW                                              $1      'foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   25     4        ASSIGN_DIM                                               !0, 'bar'
          5        OP_DATA                                                  1
   26     6        INIT_FCALL                                               'var_dump'
          7        ARRAY_KEY_EXISTS                                 ~5      'bar', !0
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class foo:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQ3GO
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      
    5     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAL                                                 'foo%3A%3AoffsetSet'
          4        DO_ICALL                                                 
    6     5      > RETURN                                                   null

End of function offsetset

Function offsetexists:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQ3GO
function name:  offsetExists
number of ops:  9
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'foo%3A%3AoffsetExists'
          3        DO_ICALL                                                 
    9     4        IS_EQUAL                                                 !0, 'foobar'
          5      > JMPZ                                                     ~2, ->7
   10     6    > > RETURN                                                   <true>
   12     7    > > RETURN                                                   <false>
   13     8*     > 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/MQ3GO
function name:  offsetUnset
number of ops:  5
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'foo%3A%3AoffsetUnset'
          3        DO_ICALL                                                 
   16     4      > 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/MQ3GO
function name:  offsetGet
number of ops:  6
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'foo%3A%3AoffsetGet'
          3        DO_ICALL                                                 
   19     4      > RETURN                                                   'value'
   20     5*     > RETURN                                                   null

End of function offsetget

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.08 ms | 1400 KiB | 15 Q