3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = '<?php function blah($num) { if ($num) { return $num + 1; } return 0; } '; $tokens = token_get_all($code); foreach ($tokens as $token) { if (is_array($token)) { echo token_name($token[0]) . "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/AvOC6
function name:  (null)
number of ops:  18
compiled vars:  !0 = $code, !1 = $tokens, !2 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fphp%0Afunction+blah%28%24num%29+%7B%0A++++if+%28%24num%29+%7B%0A++++++++return+%24num+%2B+1%3B%0A++++%7D%0A++++return+0%3B%0A%7D%0A'
   12     1        INIT_FCALL                                               'token_get_all'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   14     5      > FE_RESET_R                                       $6      !1, ->16
          6    > > FE_FETCH_R                                               $6, !2, ->16
   15     7    >   TYPE_CHECK                                  128          !2
          8      > JMPZ                                                     ~7, ->15
   16     9    >   INIT_FCALL                                               'token_name'
         10        FETCH_DIM_R                                      ~8      !2, 0
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                         $9      
         13        CONCAT                                           ~10     $9, '%0A'
         14        ECHO                                                     ~10
   14    15    > > JMP                                                      ->6
         16    >   FE_FREE                                                  $6
   18    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.1 ms | 1399 KiB | 17 Q