3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('exists' => 'foo'); if (isset($arr['exists']['non_existent'])) { echo "expected: sub-key 'non_existent' is set: "; var_dump($arr['exists']['non_existent']); } else { echo "BEHAVIOR CHANGED: sub-key 'non_existent' is not set.\n"; } if (isset($arr['exists'][1])) { echo "expected: sub-key 1 is set: "; var_dump($arr['exists'][1]); } else { echo "BEHAVIOR CHANGED: sub-key 1 is not set.\n"; } echo "-------------------\n"; if (isset($arr['exists']['non_existent']['sub_sub'])) { echo "BEHAVIOR CHANGED: sub-key 'sub_sub' is set: "; var_dump($arr['exists']['non_existent']['sub_sub']); } else { echo "good: sub-sub-key 'sub_sub' is not set.\n"; } if (isset($arr['exists'][1][0])) { echo "BEHAVIOR CHANGED: sub-sub-key 0 is set: "; var_dump($arr['exists'][1][0]); } else { echo "good: sub-sub-key 0 is not set.\n"; } echo "-------------------\n"; if (empty($arr['exists']['non_existent'])) { echo "BEHAVIOR CHANGED: sub-key 'non_existent' is empty.\n"; } else { echo "expected: sub-key 'non_existent' is not empty: "; var_dump($arr['exists']['non_existent']); } if (empty($arr['exists'][1])) { echo "BEHAVIOR CHANGED: sub-key 1 is empty.\n"; } else { echo "expected: sub-key 1 is NOT empty: "; var_dump($arr['exists'][1]); } echo "-------------------\n"; if (empty($arr['exists']['non_existent']['sub_sub'])) { echo "good: sub-sub-key 'sub_sub' is empty.\n"; } else { echo "BEHAVIOR CHANGED: sub-sub-key 'sub_sub' is not empty: "; var_dump($arr['exists']['non_existent']['sub_sub']); } if (empty($arr['exists'][1][0])) { echo "good: sub-sub-key 0 is empty.\n"; } else { echo "BEHAVIOR CHANGED: sub-sub-key 0 is not empty: "; var_dump($arr['exists'][1][0]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 36
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 49
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 67
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 80
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 87
Branch analysis from position: 87
2 jumps found. (Code = 43) Position 1 = 91, Position 2 = 93
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 93
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 80
2 jumps found. (Code = 43) Position 1 = 91, Position 2 = 93
Branch analysis from position: 91
Branch analysis from position: 93
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 80
Branch analysis from position: 78
Branch analysis from position: 80
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 67
Branch analysis from position: 65
Branch analysis from position: 67
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
Branch analysis from position: 56
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 49
Branch analysis from position: 41
Branch analysis from position: 49
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 36
Branch analysis from position: 28
Branch analysis from position: 36
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
Branch analysis from position: 22
filename:       /in/9cgRB
function name:  (null)
number of ops:  101
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        FETCH_DIM_IS                                     ~2      !0, 'exists'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, 'non_existent'
          3      > JMPZ                                                     ~3, ->11
    6     4    >   ECHO                                                     'expected%3A+sub-key+%27non_existent%27+is+set%3A+'
    7     5        INIT_FCALL                                               'var_dump'
          6        FETCH_DIM_R                                      ~4      !0, 'exists'
          7        FETCH_DIM_R                                      ~5      ~4, 'non_existent'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
         10      > JMP                                                      ->12
    9    11    >   ECHO                                                     'BEHAVIOR+CHANGED%3A+sub-key+%27non_existent%27+is+not+set.%0A'
   11    12    >   FETCH_DIM_IS                                     ~7      !0, 'exists'
         13        ISSET_ISEMPTY_DIM_OBJ                         0          ~7, 1
         14      > JMPZ                                                     ~8, ->22
   12    15    >   ECHO                                                     'expected%3A+sub-key+1+is+set%3A+'
   13    16        INIT_FCALL                                               'var_dump'
         17        FETCH_DIM_R                                      ~9      !0, 'exists'
         18        FETCH_DIM_R                                      ~10     ~9, 1
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                                 
         21      > JMP                                                      ->23
   15    22    >   ECHO                                                     'BEHAVIOR+CHANGED%3A+sub-key+1+is+not+set.%0A'
   18    23    >   ECHO                                                     '-------------------%0A'
   19    24        FETCH_DIM_IS                                     ~12     !0, 'exists'
         25        FETCH_DIM_IS                                     ~13     ~12, 'non_existent'
         26        ISSET_ISEMPTY_DIM_OBJ                         0          ~13, 'sub_sub'
         27      > JMPZ                                                     ~14, ->36
   20    28    >   ECHO                                                     'BEHAVIOR+CHANGED%3A+sub-key+%27sub_sub%27+is+set%3A+'
   21    29        INIT_FCALL                                               'var_dump'
         30        FETCH_DIM_R                                      ~15     !0, 'exists'
         31        FETCH_DIM_R                                      ~16     ~15, 'non_existent'
         32        FETCH_DIM_R                                      ~17     ~16, 'sub_sub'
         33        SEND_VAL                                                 ~17
         34        DO_ICALL                                                 
         35      > JMP                                                      ->37
   23    36    >   ECHO                                                     'good%3A+sub-sub-key+%27sub_sub%27+is+not+set.%0A'
   25    37    >   FETCH_DIM_IS                                     ~19     !0, 'exists'
         38        FETCH_DIM_IS                                     ~20     ~19, 1
         39        ISSET_ISEMPTY_DIM_OBJ                         0          ~20, 0
         40      > JMPZ                                                     ~21, ->49
   26    41    >   ECHO                                                     'BEHAVIOR+CHANGED%3A+sub-sub-key+0+is+set%3A+'
   27    42        INIT_FCALL                                               'var_dump'
         43        FETCH_DIM_R                                      ~22     !0, 'exists'
         44        FETCH_DIM_R                                      ~23     ~22, 1
         45        FETCH_DIM_R                                      ~24     ~23, 0
         46        SEND_VAL                                                 ~24
         47        DO_ICALL                                                 
         48      > JMP                                                      ->50
   29    49    >   ECHO                                                     'good%3A+sub-sub-key+0+is+not+set.%0A'
   32    50    >   ECHO                                                     '-------------------%0A'
   33    51        FETCH_DIM_IS                                     ~26     !0, 'exists'
         52        ISSET_ISEMPTY_DIM_OBJ                         1          ~26, 'non_existent'
         53      > JMPZ                                                     ~27, ->56
   34    54    >   ECHO                                                     'BEHAVIOR+CHANGED%3A+sub-key+%27non_existent%27+is+empty.%0A'
         55      > JMP                                                      ->62
   36    56    >   ECHO                                                     'expected%3A+sub-key+%27non_existent%27+is+not+empty%3A+'
   37    57        INIT_FCALL                                               'var_dump'
         58        FETCH_DIM_R                                      ~28     !0, 'exists'
         59        FETCH_DIM_R                                      ~29     ~28, 'non_existent'
         60        SEND_VAL                                                 ~29
         61        DO_ICALL                                                 
   39    62    >   FETCH_DIM_IS                                     ~31     !0, 'exists'
         63        ISSET_ISEMPTY_DIM_OBJ                         1          ~31, 1
         64      > JMPZ                                                     ~32, ->67
   40    65    >   ECHO                                                     'BEHAVIOR+CHANGED%3A+sub-key+1+is+empty.%0A'
         66      > JMP                                                      ->73
   42    67    >   ECHO                                                     'expected%3A+sub-key+1+is+NOT+empty%3A+'
   43    68        INIT_FCALL                                               'var_dump'
         69        FETCH_DIM_R                                      ~33     !0, 'exists'
         70        FETCH_DIM_R                                      ~34     ~33, 1
         71        SEND_VAL                                                 ~34
         72        DO_ICALL                                                 
   46    73    >   ECHO                                                     '-------------------%0A'
   47    74        FETCH_DIM_IS                                     ~36     !0, 'exists'
         75        FETCH_DIM_IS                                     ~37     ~36, 'non_existent'
         76        ISSET_ISEMPTY_DIM_OBJ                         1          ~37, 'sub_sub'
         77      > JMPZ                                                     ~38, ->80
   48    78    >   ECHO                                                     'good%3A+sub-sub-key+%27sub_sub%27+is+empty.%0A'
         79      > JMP                                                      ->87
   50    80    >   ECHO                                                     'BEHAVIOR+CHANGED%3A+sub-sub-key+%27sub_sub%27+is+not+empty%3A+'
   51    81        INIT_FCALL                                               'var_dump'
         82        FETCH_DIM_R                                      ~39     !0, 'exists'
         83        FETCH_DIM_R                                      ~40     ~39, 'non_existent'
         84        FETCH_DIM_R                                      ~41     ~40, 'sub_sub'
         85        SEND_VAL                                                 ~41
         86        DO_ICALL                                                 
   53    87    >   FETCH_DIM_IS                                     ~43     !0, 'exists'
         88        FETCH_DIM_IS                                     ~44     ~43, 1
         89        ISSET_ISEMPTY_DIM_OBJ                         1          ~44, 0
         90      > JMPZ                                                     ~45, ->93
   54    91    >   ECHO                                                     'good%3A+sub-sub-key+0+is+empty.%0A'
         92      > JMP                                                      ->100
   56    93    >   ECHO                                                     'BEHAVIOR+CHANGED%3A+sub-sub-key+0+is+not+empty%3A+'
   57    94        INIT_FCALL                                               'var_dump'
         95        FETCH_DIM_R                                      ~46     !0, 'exists'
         96        FETCH_DIM_R                                      ~47     ~46, 1
         97        FETCH_DIM_R                                      ~48     ~47, 0
         98        SEND_VAL                                                 ~48
         99        DO_ICALL                                                 
   58   100    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.51 ms | 1404 KiB | 15 Q