3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('DEFINED_AS_TRUE', true); define('DEFINED_AS_FALSE', false); echo 'Case A when not defined: '; if ((!THIS_IS_NOT_DEFINED) || !defined('THIS_IS_NOT_DEFINED')) { echo 'if is true'; } else { echo 'if is false'; } echo "\n\n"; echo 'Case B when not defined: '; if ((!defined('THIS_IS_NOT_DEFINED')) || (!THIS_IS_NOT_DEFINED)) { echo 'if is true'; } else { echo 'if is false'; } echo "\n\n"; echo 'Case A when defined as true: '; if ((!DEFINED_AS_TRUE) || !defined('DEFINED_AS_TRUE')) { echo 'if is true'; } else { echo 'if is false'; } echo "\n\n"; echo 'Case B when defined as true: '; if ((!defined('DEFINED_AS_TRUE')) || (!DEFINED_AS_TRUE)) { echo 'if is true'; } else { echo 'if is false'; } echo "\n\n"; echo 'Case A when defined as false: '; if ((!DEFINED_AS_FALSE) || !defined('DEFINED_AS_FALSE')) { echo 'if is true'; } else { echo 'if is false'; } echo "\n\n"; echo 'Case B when defined as false: '; if ((!defined('DEFINED_AS_FALSE')) || (!DEFINED_AS_FALSE)) { echo 'if is true'; } else { echo 'if is false'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 47) Position 1 = 36, Position 2 = 39
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 47) Position 1 = 48, Position 2 = 51
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 47) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 66
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 47) Position 1 = 72, Position 2 = 75
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 76, Position 2 = 78
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 75
Branch analysis from position: 66
2 jumps found. (Code = 47) Position 1 = 72, Position 2 = 75
Branch analysis from position: 72
Branch analysis from position: 75
Branch analysis from position: 63
Branch analysis from position: 54
2 jumps found. (Code = 47) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
Branch analysis from position: 63
Branch analysis from position: 51
Branch analysis from position: 42
2 jumps found. (Code = 47) Position 1 = 48, Position 2 = 51
Branch analysis from position: 48
Branch analysis from position: 51
Branch analysis from position: 39
Branch analysis from position: 30
2 jumps found. (Code = 47) Position 1 = 36, Position 2 = 39
Branch analysis from position: 36
Branch analysis from position: 39
Branch analysis from position: 27
Branch analysis from position: 18
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
Branch analysis from position: 27
Branch analysis from position: 15
filename:       /in/ED6iJ
function name:  (null)
number of ops:  80
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'DEFINED_AS_TRUE'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                                 
    3     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'DEFINED_AS_FALSE'
          6        SEND_VAL                                                 <false>
          7        DO_ICALL                                                 
    5     8        ECHO                                                     'Case+A+when+not+defined%3A+'
    6     9        FETCH_CONSTANT                                   ~2      'THIS_IS_NOT_DEFINED'
         10        BOOL_NOT                                         ~3      ~2
         11      > JMPNZ_EX                                         ~3      ~3, ->15
         12    >   DEFINED                                          ~4      'THIS_IS_NOT_DEFINED'
         13        BOOL_NOT                                         ~5      ~4
         14        BOOL                                             ~3      ~5
         15    > > JMPZ                                                     ~3, ->18
    7    16    >   ECHO                                                     'if+is+true'
         17      > JMP                                                      ->19
   10    18    >   ECHO                                                     'if+is+false'
   13    19    >   ECHO                                                     '%0A%0A'
   15    20        ECHO                                                     'Case+B+when+not+defined%3A+'
   16    21        DEFINED                                          ~6      'THIS_IS_NOT_DEFINED'
         22        BOOL_NOT                                         ~7      ~6
         23      > JMPNZ_EX                                         ~7      ~7, ->27
         24    >   FETCH_CONSTANT                                   ~8      'THIS_IS_NOT_DEFINED'
         25        BOOL_NOT                                         ~9      ~8
         26        BOOL                                             ~7      ~9
         27    > > JMPZ                                                     ~7, ->30
   17    28    >   ECHO                                                     'if+is+true'
         29      > JMP                                                      ->31
   20    30    >   ECHO                                                     'if+is+false'
   23    31    >   ECHO                                                     '%0A%0A'
   25    32        ECHO                                                     'Case+A+when+defined+as+true%3A+'
   26    33        FETCH_CONSTANT                                   ~10     'DEFINED_AS_TRUE'
         34        BOOL_NOT                                         ~11     ~10
         35      > JMPNZ_EX                                         ~11     ~11, ->39
         36    >   DEFINED                                          ~12     'DEFINED_AS_TRUE'
         37        BOOL_NOT                                         ~13     ~12
         38        BOOL                                             ~11     ~13
         39    > > JMPZ                                                     ~11, ->42
   27    40    >   ECHO                                                     'if+is+true'
         41      > JMP                                                      ->43
   30    42    >   ECHO                                                     'if+is+false'
   33    43    >   ECHO                                                     '%0A%0A'
   35    44        ECHO                                                     'Case+B+when+defined+as+true%3A+'
   36    45        DEFINED                                          ~14     'DEFINED_AS_TRUE'
         46        BOOL_NOT                                         ~15     ~14
         47      > JMPNZ_EX                                         ~15     ~15, ->51
         48    >   FETCH_CONSTANT                                   ~16     'DEFINED_AS_TRUE'
         49        BOOL_NOT                                         ~17     ~16
         50        BOOL                                             ~15     ~17
         51    > > JMPZ                                                     ~15, ->54
   37    52    >   ECHO                                                     'if+is+true'
         53      > JMP                                                      ->55
   40    54    >   ECHO                                                     'if+is+false'
   43    55    >   ECHO                                                     '%0A%0A'
   45    56        ECHO                                                     'Case+A+when+defined+as+false%3A+'
   46    57        FETCH_CONSTANT                                   ~18     'DEFINED_AS_FALSE'
         58        BOOL_NOT                                         ~19     ~18
         59      > JMPNZ_EX                                         ~19     ~19, ->63
         60    >   DEFINED                                          ~20     'DEFINED_AS_FALSE'
         61        BOOL_NOT                                         ~21     ~20
         62        BOOL                                             ~19     ~21
         63    > > JMPZ                                                     ~19, ->66
   47    64    >   ECHO                                                     'if+is+true'
         65      > JMP                                                      ->67
   50    66    >   ECHO                                                     'if+is+false'
   53    67    >   ECHO                                                     '%0A%0A'
   55    68        ECHO                                                     'Case+B+when+defined+as+false%3A+'
   56    69        DEFINED                                          ~22     'DEFINED_AS_FALSE'
         70        BOOL_NOT                                         ~23     ~22
         71      > JMPNZ_EX                                         ~23     ~23, ->75
         72    >   FETCH_CONSTANT                                   ~24     'DEFINED_AS_FALSE'
         73        BOOL_NOT                                         ~25     ~24
         74        BOOL                                             ~23     ~25
         75    > > JMPZ                                                     ~23, ->78
   57    76    >   ECHO                                                     'if+is+true'
         77      > JMP                                                      ->79
   60    78    >   ECHO                                                     'if+is+false'
   61    79    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
197.57 ms | 1404 KiB | 15 Q