3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "//define('ID', '');"; $tokens = token_get_all("<?php $string"); if ($tokens[1][0] == T_COMMENT) { echo 'comment'; } else { echo 'nope'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GbiI4
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $tokens
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%2Fdefine%28%27ID%27%2C+%27%27%29%3B'
    5     1        INIT_FCALL                                               'token_get_all'
          2        NOP                                                      
          3        FAST_CONCAT                                      ~3      '%3C%3Fphp+', !0
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    7     7        FETCH_DIM_R                                      ~6      !1, 1
          8        FETCH_DIM_R                                      ~7      ~6, 0
          9        IS_EQUAL                                                 ~7, 388
         10      > JMPZ                                                     ~8, ->13
    8    11    >   ECHO                                                     'comment'
         12      > JMP                                                      ->14
   10    13    >   ECHO                                                     'nope'
   11    14    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.34 ms | 1398 KiB | 15 Q