3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code =<<<PHP_CODE <?php function test($a) { echo $a; } $a = 10; test($a); PHP_CODE; $tokens = token_get_all($code); var_dump($tokens); foreach ($tokens as $row) { if (is_numeric($row[0])) { echo token_name($row[0]), "\r\n"; } print_r($row); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 34
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 34
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 30
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/ASm4g
function name:  (null)
number of ops:  36
compiled vars:  !0 = $code, !1 = $a, !2 = $tokens, !3 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ROPE_INIT                                     9  ~5      '%3C%3Fphp%0Afunction+test%28'
    5     1        ROPE_ADD                                      1  ~5      ~5, !1
          2        ROPE_ADD                                      2  ~5      ~5, '%29+%7B%0A++++echo+'
    6     3        ROPE_ADD                                      3  ~5      ~5, !1
          4        ROPE_ADD                                      4  ~5      ~5, '%3B%0A%7D%0A%0A'
    9     5        ROPE_ADD                                      5  ~5      ~5, !1
          6        ROPE_ADD                                      6  ~5      ~5, '+%3D+10%3B%0Atest%28'
   10     7        ROPE_ADD                                      7  ~5      ~5, !1
          8        ROPE_END                                      8  ~4      ~5, '%29%3B'
    3     9        ASSIGN                                                   !0, ~4
   13    10        INIT_FCALL                                               'token_get_all'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $11     
         13        ASSIGN                                                   !2, $11
   14    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
   16    17      > FE_RESET_R                                       $14     !2, ->34
         18    > > FE_FETCH_R                                               $14, !3, ->34
   17    19    >   INIT_FCALL                                               'is_numeric'
         20        FETCH_DIM_R                                      ~15     !3, 0
         21        SEND_VAL                                                 ~15
         22        DO_ICALL                                         $16     
         23      > JMPZ                                                     $16, ->30
   18    24    >   INIT_FCALL                                               'token_name'
         25        FETCH_DIM_R                                      ~17     !3, 0
         26        SEND_VAL                                                 ~17
         27        DO_ICALL                                         $18     
         28        ECHO                                                     $18
         29        ECHO                                                     '%0D%0A'
   20    30    >   INIT_FCALL                                               'print_r'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                                 
   16    33      > JMP                                                      ->18
         34    >   FE_FREE                                                  $14
   21    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.61 ms | 1396 KiB | 23 Q