3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.19 ms | 1404 KiB | 17 Q