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); ; foreach ($tokens as $row) { if (is_numeric($row[0])) { echo token_name($row[0]), "\r\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 28
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 28
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 27
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/QalSu
function name:  (null)
number of ops:  30
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
   16    14      > FE_RESET_R                                       $13     !2, ->28
         15    > > FE_FETCH_R                                               $13, !3, ->28
   17    16    >   INIT_FCALL                                               'is_numeric'
         17        FETCH_DIM_R                                      ~14     !3, 0
         18        SEND_VAL                                                 ~14
         19        DO_ICALL                                         $15     
         20      > JMPZ                                                     $15, ->27
   18    21    >   INIT_FCALL                                               'token_name'
         22        FETCH_DIM_R                                      ~16     !3, 0
         23        SEND_VAL                                                 ~16
         24        DO_ICALL                                         $17     
         25        ECHO                                                     $17
         26        ECHO                                                     '%0D%0A'
   16    27    > > JMP                                                      ->15
         28    >   FE_FREE                                                  $13
   21    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.5 ms | 1396 KiB | 19 Q