3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.87 ms | 1400 KiB | 19 Q