3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyStuff extends ArrayObject { function offsetGet($offset) { echo "Called"; return parent::offsetGet($offset); } } $array = array('foo' => 42); $array_object = new MyStuff($array); var_dump(isset($array['foo'])); var_dump(empty($array['foo'])); var_dump(isset($array_object['foo'])); var_dump(empty($array_object['foo']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p0Gcq
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $array_object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   14     1        NEW                                              $3      'MyStuff'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   16     5        INIT_FCALL                                               'var_dump'
          6        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !0, 'foo'
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                                 
   17     9        INIT_FCALL                                               'var_dump'
         10        ISSET_ISEMPTY_DIM_OBJ                         1  ~8      !0, 'foo'
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                                 
   19    13        INIT_FCALL                                               'var_dump'
         14        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !1, 'foo'
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                                 
   20    17        INIT_FCALL                                               'var_dump'
         18        ISSET_ISEMPTY_DIM_OBJ                         1  ~12     !1, 'foo'
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class MyStuff:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p0Gcq
function name:  offsetGet
number of ops:  7
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ECHO                                                     'Called'
    8     2        INIT_STATIC_METHOD_CALL                                  'offsetGet'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $1      
          5      > RETURN                                                   $1
    9     6*     > RETURN                                                   null

End of function offsetget

End of class MyStuff.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.42 ms | 1396 KiB | 15 Q