3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C implements ArrayAccess { public function offsetGet($offset) { return 'value'; } public function offsetExists($offset) { if ($offset == 'pWithNull') { return null; } if ($offset == 'pWithFalse') { return false; } if ($offset == 'pWithTrue') { return true; } return false; } public function offsetSet($offset, $value) { // nothing } public function offsetUnset($offset) { // nothing } } $o = new C(); var_dump( isset($o->pWithFalse), empty($o->pWithFalse) ); var_dump( isset($o->pWithNull), empty($o->pWithNull) ); var_dump( isset($o->pWithTrue), empty($o->pWithTrue) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z2Frh
function name:  (null)
number of ops:  23
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'c'
   34     1        NEW                                              $1      'C'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   36     4        INIT_FCALL                                               'var_dump'
   37     5        ISSET_ISEMPTY_PROP_OBJ                           ~4      !0, 'pWithFalse'
          6        SEND_VAL                                                 ~4
   38     7        ISSET_ISEMPTY_PROP_OBJ                           ~5      !0, 'pWithFalse'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
   41    10        INIT_FCALL                                               'var_dump'
   42    11        ISSET_ISEMPTY_PROP_OBJ                           ~7      !0, 'pWithNull'
         12        SEND_VAL                                                 ~7
   43    13        ISSET_ISEMPTY_PROP_OBJ                           ~8      !0, 'pWithNull'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   46    16        INIT_FCALL                                               'var_dump'
   47    17        ISSET_ISEMPTY_PROP_OBJ                           ~10     !0, 'pWithTrue'
         18        SEND_VAL                                                 ~10
   48    19        ISSET_ISEMPTY_PROP_OBJ                           ~11     !0, 'pWithTrue'
         20        SEND_VAL                                                 ~11
         21        DO_ICALL                                                 
   49    22      > RETURN                                                   1

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

End of function offsetget

Function offsetexists:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
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
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z2Frh
function name:  offsetExists
number of ops:  12
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        IS_EQUAL                                                 !0, 'pWithNull'
          2      > JMPZ                                                     ~1, ->4
   12     3    > > RETURN                                                   null
   14     4    >   IS_EQUAL                                                 !0, 'pWithFalse'
          5      > JMPZ                                                     ~2, ->7
   15     6    > > RETURN                                                   <false>
   17     7    >   IS_EQUAL                                                 !0, 'pWithTrue'
          8      > JMPZ                                                     ~3, ->10
   18     9    > > RETURN                                                   <true>
   20    10    > > RETURN                                                   <false>
   21    11*     > RETURN                                                   null

End of function offsetexists

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z2Frh
function name:  offsetSet
number of ops:  3
compiled vars:  !0 = $offset, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   26     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/Z2Frh
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
   31     1      > RETURN                                                   null

End of function offsetunset

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.82 ms | 1395 KiB | 16 Q