3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.03 ms | 1395 KiB | 17 Q