3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<?php array( \'one\' => \'hello\', \'two\' => "hello", \'three\' => array(1,2,3), \'four\' => $asset->delete(), ); '; $string = '<?php array(); '; $tokens = token_get_all($string); foreach ($tokens as $i => $token) { echo "$i : "; if (is_array($token) === false) { echo $token; } else { echo token_name($token[0]).' => '.str_replace(PHP_EOL, '\n', $token[1]); } echo PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 32
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 32
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/lnOq3
function name:  (null)
number of ops:  34
compiled vars:  !0 = $string, !1 = $tokens, !2 = $token, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fphp%0A%0Aarray%28%0A++++%27one%27+%3D%3E+%27hello%27%2C+%27two%27+%3D%3E+%22hello%22%2C%0A++++%27three%27+%3D%3E+array%281%2C2%2C3%29%2C+%27four%27+%3D%3E+%24asset-%3Edelete%28%29%2C%0A++++%29%3B%0A'
   11     1        ASSIGN                                                   !0, '%3C%3Fphp+array%28%29%3B+'
   13     2        INIT_FCALL                                               'token_get_all'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   14     6      > FE_RESET_R                                       $8      !1, ->32
          7    > > FE_FETCH_R                                       ~9      $8, !2, ->32
          8    >   ASSIGN                                                   !3, ~9
   15     9        NOP                                                      
         10        FAST_CONCAT                                      ~11     !3, '+%3A+'
         11        ECHO                                                     ~11
   16    12        TYPE_CHECK                                  128  ~12     !2
         13        TYPE_CHECK                                    4          ~12
         14      > JMPZ                                                     ~13, ->17
   17    15    >   ECHO                                                     !2
         16      > JMP                                                      ->30
   19    17    >   INIT_FCALL                                               'token_name'
         18        FETCH_DIM_R                                      ~14     !2, 0
         19        SEND_VAL                                                 ~14
         20        DO_ICALL                                         $15     
         21        CONCAT                                           ~16     $15, '+%3D%3E+'
         22        INIT_FCALL                                               'str_replace'
         23        SEND_VAL                                                 '%0A'
         24        SEND_VAL                                                 '%5Cn'
         25        FETCH_DIM_R                                      ~17     !2, 1
         26        SEND_VAL                                                 ~17
         27        DO_ICALL                                         $18     
         28        CONCAT                                           ~19     ~16, $18
         29        ECHO                                                     ~19
   22    30    >   ECHO                                                     '%0A'
   14    31      > JMP                                                      ->7
         32    >   FE_FREE                                                  $8
   23    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.92 ms | 1396 KiB | 19 Q