3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = '<?php function extractURL($url) { if (preg_match(\'#http://www.bing.com/?$#i\', $url, $match)) { return $match[1]; } return null; } '; $tokens = token_get_all($code); print_r($tokens); 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 = 9, Position 2 = 35
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 35
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/DgYPL
function name:  (null)
number of ops:  37
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.bing.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        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   13     8      > FE_RESET_R                                       $7      !1, ->35
          9    > > FE_FETCH_R                                               $7, !2, ->35
   14    10    >   TYPE_CHECK                                   64          !2
         11      > JMPZ                                                     ~8, ->16
   15    12    >   CONCAT                                           ~9      '%5B%28string+token%29%5D+', !2
         13        CONCAT                                           ~10     ~9, '%0D%0A'
         14        ECHO                                                     ~10
         15      > JMP                                                      ->34
   16    16    >   FETCH_DIM_R                                      ~11     !2, 0
         17        IS_IDENTICAL                                             ~11, 393
         18      > JMPZ                                                     ~12, ->21
   17    19    >   ECHO                                                     '%5BT_WHITESPACE%5D%0D%0A'
         20      > JMP                                                      ->34
   19    21    >   INIT_FCALL                                               'token_name'
         22        FETCH_DIM_R                                      ~13     !2, 0
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                         $14     
         25        CONCAT                                           ~15     '%5B', $14
         26        CONCAT                                           ~16     ~15, '%5D+'
         27        INIT_FCALL                                               'trim'
         28        FETCH_DIM_R                                      ~17     !2, 1
         29        SEND_VAL                                                 ~17
         30        DO_ICALL                                         $18     
         31        CONCAT                                           ~19     ~16, $18
         32        CONCAT                                           ~20     ~19, '%0D%0A'
         33        ECHO                                                     ~20
   13    34    > > JMP                                                      ->9
         35    >   FE_FREE                                                  $7
   21    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 1392 KiB | 21 Q