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

End of function offsetget

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.86 ms | 1400 KiB | 17 Q