3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('CONSTANT', 1); define('_CONSTANT', 0); define('EMPTY', ''); $a = '0'; 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 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/TbeFZ
function name:  (null)
number of ops:  29
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                                                 1
          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                                                 
    5    12        ASSIGN                                                   !0, '0'
    6    13        ISSET_ISEMPTY_CV                                 ~5      !0
         14        BOOL_NOT                                         ~6      ~5
         15      > JMPZ                                                     ~6, ->22
    7    16    >   FETCH_CONSTANT                                   ~7      '_CONSTANT'
         17        BOOL                                             ~8      ~7
         18        BOOL_NOT                                         ~9      ~8
         19      > JMPZ                                                     ~9, ->21
    8    20    >   ECHO                                                     1
         21    > > JMP                                                      ->28
   10    22    >   INIT_FCALL                                               'constant'
         23        SEND_VAL                                                 'CONSTANT'
         24        DO_ICALL                                         $10     
         25        IS_EQUAL                                                 $10, 1
         26      > JMPZ                                                     ~11, ->28
   11    27    >   ECHO                                                     2
   12    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.36 ms | 1396 KiB | 17 Q