3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('CONSTANT', ''); define('_CONSTANT', 0); define('EMPTY', ''); var_dump(CONSTANT); $a = '5'; if (!empty($a)) { if (!(boolean) _CONSTANT) { echo 1; } } else if (constant('CONSTANT') == 1) { echo 2; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/luKt8
function name:  (null)
number of ops:  33
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'CONSTANT'
          2        SEND_VAL                                                 ''
          3        DO_ICALL                                                 
    3     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 '_CONSTANT'
          6        SEND_VAL                                                 0
          7        DO_ICALL                                                 
    4     8        INIT_FCALL                                               'define'
          9        SEND_VAL                                                 'EMPTY'
         10        SEND_VAL                                                 ''
         11        DO_ICALL                                                 
    6    12        INIT_FCALL                                               'var_dump'
         13        FETCH_CONSTANT                                   ~4      'CONSTANT'
         14        SEND_VAL                                                 ~4
         15        DO_ICALL                                                 
    8    16        ASSIGN                                                   !0, '5'
   10    17        ISSET_ISEMPTY_CV                                 ~7      !0
         18        BOOL_NOT                                         ~8      ~7
         19      > JMPZ                                                     ~8, ->26
   11    20    >   FETCH_CONSTANT                                   ~9      '_CONSTANT'
         21        BOOL                                             ~10     ~9
         22        BOOL_NOT                                         ~11     ~10
         23      > JMPZ                                                     ~11, ->25
   12    24    >   ECHO                                                     1
         25    > > JMP                                                      ->32
   14    26    >   INIT_FCALL                                               'constant'
         27        SEND_VAL                                                 'CONSTANT'
         28        DO_ICALL                                         $12     
         29        IS_EQUAL                                                 $12, 1
         30      > JMPZ                                                     ~13, ->32
   15    31    >   ECHO                                                     2
   16    32    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.56 ms | 1396 KiB | 19 Q