3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.1 ms | 1387 KiB | 17 Q