3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements ArrayAccess { public function offsetExists($offset) { print 'offsetExists called with: ' . $offset; } public function offsetGet($offset) { print 'offsetGet called with: ' . $offset; } public function offsetSet($offset, $value) { } public function offsetUnset($offset) { } } $foo = new Foo(); $foo['bar']; print "\n\n"; $foo['baz'] ?? null;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLqvr
function name:  (null)
number of ops:  12
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
   26     4        FETCH_DIM_R                                      ~4      !0, 'bar'
          5        FREE                                                     ~4
   27     6        ECHO                                                     '%0A%0A'
   29     7        FETCH_DIM_IS                                     ~5      !0, 'baz'
          8        COALESCE                                         ~6      ~5
          9        QM_ASSIGN                                        ~6      null
         10        FREE                                                     ~6
   30    11      > RETURN                                                   1

Class Foo:
Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLqvr
function name:  offsetExists
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        CONCAT                                           ~1      'offsetExists+called+with%3A+', !0
          2        ECHO                                                     ~1
    8     3      > RETURN                                                   null

End of function offsetexists

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLqvr
function name:  offsetGet
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        CONCAT                                           ~1      'offsetGet+called+with%3A+', !0
          2        ECHO                                                     ~1
   13     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/OLqvr
function name:  offsetSet
number of ops:  3
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     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/OLqvr
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1      > RETURN                                                   null

End of function offsetunset

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.51 ms | 1007 KiB | 13 Q