3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = <<<EOD <?php include_once "noentry.php"; list(\$get_arr, \$post_arr, \$request_arr) = get_secure_request_params(); \$mode = empty(\$get_arr['mode']) ? 'add' : \$get_arr['mode']; try { if (!in_array(strtolower(\$mode), ['add', 'update'])) { throw new Exception("Error Processing Request", 0); } \$msg = trim(\$get_arr['var_msg']); if (strtolower(\$mode) == 'update') { \$top_header="Update ".'$module_header'; \$id = \$get_arr['$table_primary_key']; \$db_data = \$mfa_db_obj->db->table('$table_name')->select('*')->where('$table_primary_key', \$id)->first(); if(empty(\$db_data)) { \$redirect_url=\$admin_url."index.php?file=sitemap&AX=No"; header("Location:".\$redirect_url); } } } catch (Exception \$e) { \$exception_message=\$e->getMessage(); \$redirect_url=\$admin_url . "{$listing_url}&var_msg=".\$exception_message; header("Location:".\$redirect_url); exit; } include_once "common_css.php"; include_once "common_js.php"; ?> EOD; $tokens = token_get_all($source); foreach ($tokens as $token) { list($id, $text) = get_token($token); $lower_text = strtolower($text); if (T_STRING == $id && isset($alias_list[$lower_text])) { $alias_count[$lower_text] ++; } $return .= $text; } function get_token($token) { if (is_string($token)) { return array($token, $token); } else { return $token; } } echo $return;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 39
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 39
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 37
Branch analysis from position: 34
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/IHp8p
function name:  (null)
number of ops:  42
compiled vars:  !0 = $source, !1 = $module_header, !2 = $table_primary_key, !3 = $table_name, !4 = $listing_url, !5 = $tokens, !6 = $token, !7 = $id, !8 = $text, !9 = $lower_text, !10 = $alias_list, !11 = $alias_count, !12 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ROPE_INIT                                    11  ~14     '%3C%3Fphp%0Ainclude_once+%22noentry.php%22%3B%0A%0Alist%28%24get_arr%2C+%24post_arr%2C+%24request_arr%29+%3D+get_secure_request_params%28%29%3B%0A%24mode+%3D+empty%28%24get_arr%5B%27mode%27%5D%29+%3F+%27add%27+%3A+%24get_arr%5B%27mode%27%5D%3B%0Atry+%7B%0A++++if+%28%21in_array%28strtolower%28%24mode%29%2C+%5B%27add%27%2C+%27update%27%5D%29%29+%7B%0A++++++++throw+new+Exception%28%22Error+Processing+Request%22%2C+0%29%3B%0A++++%7D%0A++++%24msg+%3D+trim%28%24get_arr%5B%27var_msg%27%5D%29%3B%0A++++if+%28strtolower%28%24mode%29+%3D%3D+%27update%27%29+%7B%0A++++++++%24top_header%3D%22Update+%22.%27'
   14     1        ROPE_ADD                                      1  ~14     ~14, !1
          2        ROPE_ADD                                      2  ~14     ~14, '%27%3B%0A++++++++%24id+%3D+%24get_arr%5B%27'
   15     3        ROPE_ADD                                      3  ~14     ~14, !2
          4        ROPE_ADD                                      4  ~14     ~14, '%27%5D%3B%0A++++++++%24db_data+%3D+%24mfa_db_obj-%3Edb-%3Etable%28%27'
   16     5        ROPE_ADD                                      5  ~14     ~14, !3
          6        ROPE_ADD                                      6  ~14     ~14, '%27%29-%3Eselect%28%27%2A%27%29-%3Ewhere%28%27'
          7        ROPE_ADD                                      7  ~14     ~14, !2
          8        ROPE_ADD                                      8  ~14     ~14, '%27%2C+%24id%29-%3Efirst%28%29%3B%0A++++++++if%28empty%28%24db_data%29%29%0A++++++++%7B%0A++++++++++++%24redirect_url%3D%24admin_url.%22index.php%3Ffile%3Dsitemap%26AX%3DNo%22%3B%0A++++++++++++header%28%22Location%3A%22.%24redirect_url%29%3B%0A++++++++%7D%0A++++%7D%0A%7D+catch+%28Exception+%24e%29+%7B%0A++++%24exception_message%3D%24e-%3EgetMessage%28%29%3B%0A++++%24redirect_url%3D%24admin_url+.+%22'
   25     9        ROPE_ADD                                      9  ~14     ~14, !4
         10        ROPE_END                                     10  ~13     ~14, '%26var_msg%3D%22.%24exception_message%3B%0A++++header%28%22Location%3A%22.%24redirect_url%29%3B%0A++++exit%3B%0A%7D%0Ainclude_once+%22common_css.php%22%3B%0Ainclude_once+%22common_js.php%22%3B%0A%3F%3E'
    2    11        ASSIGN                                                   !0, ~13
   33    12        INIT_FCALL                                               'token_get_all'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $21     
         15        ASSIGN                                                   !5, $21
   34    16      > FE_RESET_R                                       $23     !5, ->39
         17    > > FE_FETCH_R                                               $23, !6, ->39
   35    18    >   INIT_FCALL_BY_NAME                                       'get_token'
         19        SEND_VAR_EX                                              !6
         20        DO_FCALL                                      0  $24     
         21        FETCH_LIST_R                                     $25     $24, 0
         22        ASSIGN                                                   !7, $25
         23        FETCH_LIST_R                                     $27     $24, 1
         24        ASSIGN                                                   !8, $27
         25        FREE                                                     $24
   36    26        INIT_FCALL                                               'strtolower'
         27        SEND_VAR                                                 !8
         28        DO_ICALL                                         $29     
         29        ASSIGN                                                   !9, $29
   37    30        IS_EQUAL                                         ~31     !7, 311
         31      > JMPZ_EX                                          ~31     ~31, ->34
         32    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~32     !10, !9
         33        BOOL                                             ~31     ~32
         34    > > JMPZ                                                     ~31, ->37
   38    35    >   FETCH_DIM_RW                                     $33     !11, !9
         36        PRE_INC                                                  $33
   40    37    >   ASSIGN_OP                                     8          !12, !8
   34    38      > JMP                                                      ->17
         39    >   FE_FREE                                                  $23
   49    40        ECHO                                                     !12
   50    41      > RETURN                                                   1

Function get_token:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IHp8p
function name:  get_token
number of ops:  9
compiled vars:  !0 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   RECV                                             !0      
   43     1        TYPE_CHECK                                   64          !0
          2      > JMPZ                                                     ~1, ->7
   44     3    >   INIT_ARRAY                                       ~2      !0
          4        ADD_ARRAY_ELEMENT                                ~2      !0
          5      > RETURN                                                   ~2
          6*       JMP                                                      ->8
   46     7    > > RETURN                                                   !0
   48     8*     > RETURN                                                   null

End of function get_token

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.1 ms | 1400 KiB | 17 Q