3v4l.org

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

Class SomeArray:
Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PrQ80
function name:  offsetExists
number of ops:  9
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Called%3A+SomeArray%3A%3AoffsetExists'
          3        DO_ICALL                                                 
    7     4        INIT_STATIC_METHOD_CALL                                  'offsetExists'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $2      
          7      > RETURN                                                   $2
    8     8*     > 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/PrQ80
function name:  offsetGet
number of ops:  9
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Called%3A+SomeArray%3A%3AoffsetGet'
          3        DO_ICALL                                                 
   12     4        INIT_STATIC_METHOD_CALL                                  'offsetGet'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $2      
          7      > RETURN                                                   $2
   13     8*     > 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/PrQ80
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/PrQ80
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1      > RETURN                                                   null

End of function offsetunset

End of class SomeArray.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.9 ms | 1400 KiB | 15 Q