3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = ['someKey' => 'someValue']; echo $var['someKey']; $wasSet = isset($var['aKey']); if ($wasSet) { echo "was set"; } else { echo "was not set"; } $possibleVar = $var['aKey']; if ($possibleVar) { echo "possible var: $possibleVar"; } else { echo "possible var is false: $possibleVar"; } function testIsSet($arg, $key) { if (isset($arg[$key])) { return $arg[$key]; } return "Default value"; } $retrievedValue = testIsSet($var, 'aKey'); echo "\n\nRetrieved value is $retrievedValue\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
Branch analysis from position: 16
filename:       /in/rfLbK
function name:  (null)
number of ops:  29
compiled vars:  !0 = $var, !1 = $wasSet, !2 = $possibleVar, !3 = $retrievedValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        FETCH_DIM_R                                      ~5      !0, 'someKey'
          2        ECHO                                                     ~5
    7     3        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !0, 'aKey'
          4        ASSIGN                                                   !1, ~6
    9     5      > JMPZ                                                     !1, ->8
   10     6    >   ECHO                                                     'was+set'
          7      > JMP                                                      ->9
   12     8    >   ECHO                                                     'was+not+set'
   15     9    >   FETCH_DIM_R                                      ~8      !0, 'aKey'
         10        ASSIGN                                                   !2, ~8
   17    11      > JMPZ                                                     !2, ->16
   18    12    >   NOP                                                      
         13        FAST_CONCAT                                      ~10     'possible+var%3A+', !2
         14        ECHO                                                     ~10
         15      > JMP                                                      ->19
   20    16    >   NOP                                                      
         17        FAST_CONCAT                                      ~11     'possible+var+is+false%3A+', !2
         18        ECHO                                                     ~11
   30    19    >   INIT_FCALL                                               'testisset'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 'aKey'
         22        DO_FCALL                                      0  $12     
         23        ASSIGN                                                   !3, $12
   32    24        ROPE_INIT                                     3  ~15     '%0A%0ARetrieved+value+is+'
         25        ROPE_ADD                                      1  ~15     ~15, !3
         26        ROPE_END                                      2  ~14     ~15, '%0A'
         27        ECHO                                                     ~14
         28      > RETURN                                                   1

Function testisset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rfLbK
function name:  testIsSet
number of ops:  8
compiled vars:  !0 = $arg, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   24     2        ISSET_ISEMPTY_DIM_OBJ                         0          !0, !1
          3      > JMPZ                                                     ~2, ->6
   25     4    >   FETCH_DIM_R                                      ~3      !0, !1
          5      > RETURN                                                   ~3
   27     6    > > RETURN                                                   'Default+value'
   28     7*     > RETURN                                                   null

End of function testisset

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.1 ms | 1403 KiB | 14 Q