3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$x) {} $i = 0; foo(++$i); $php = <<<'EOT' <?php namespace AAA\BBB; use XXX\YYY; // Comment # Comment /* Comment */ /** * @doc */ abstract class C extends ZZZ implements III, JJJ { function & foo() {} } EOT; for ($i = 258; $i < 409; ++$i) { $name = token_name($i); # print "$i: $name\n"; } $tokens = token_get_all($php); $readable = ''; foreach ($tokens as $token) { if (is_array($token)) { list($id, $str, $line) = $token; $name = token_name($id); $readable .= "<$id:$name>$str"; } else { $readable .= "<*>$token"; } } print $readable;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 8
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 48
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 48
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 44
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 8
Branch analysis from position: 15
Branch analysis from position: 8
filename:       /in/Zh52l
function name:  (null)
number of ops:  51
compiled vars:  !0 = $i, !1 = $php, !2 = $name, !3 = $tokens, !4 = $readable, !5 = $token, !6 = $id, !7 = $str, !8 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 0
    5     1        INIT_FCALL                                               'foo'
          2        PRE_INC                                          ~10     !0
          3        SEND_VAL_EX                                              ~10
          4        DO_FCALL                                      0          
    7     5        ASSIGN                                                   !1, '%3C%3Fphp%0A%0Anamespace+AAA%5CBBB%3B%0A%0Ause+XXX%5CYYY%3B%0A%0A%2F%2F+Comment%0A%0A%23+Comment%0A%0A%2F%2A+Comment+%2A%2F%0A%0A%2F%2A%2A%0A+%2A+%40doc%0A+%2A%2F%0Aabstract+class+C%0A++extends+ZZZ%0A++implements+III%2C+JJJ%0A%7B%0A++++function+%26+foo%28%29+%7B%7D%0A%7D%0A'
   32     6        ASSIGN                                                   !0, 258
          7      > JMP                                                      ->13
   33     8    >   INIT_FCALL                                               'token_name'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $14     
         11        ASSIGN                                                   !2, $14
   32    12        PRE_INC                                                  !0
         13    >   IS_SMALLER                                               !0, 409
         14      > JMPNZ                                                    ~17, ->8
   38    15    >   INIT_FCALL                                               'token_get_all'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $18     
         18        ASSIGN                                                   !3, $18
   40    19        ASSIGN                                                   !4, ''
   41    20      > FE_RESET_R                                       $21     !3, ->48
         21    > > FE_FETCH_R                                               $21, !5, ->48
   42    22    >   TYPE_CHECK                                  128          !5
         23      > JMPZ                                                     ~22, ->44
   43    24    >   QM_ASSIGN                                        ~23     !5
         25        FETCH_LIST_R                                     $24     ~23, 0
         26        ASSIGN                                                   !6, $24
         27        FETCH_LIST_R                                     $26     ~23, 1
         28        ASSIGN                                                   !7, $26
         29        FETCH_LIST_R                                     $28     ~23, 2
         30        ASSIGN                                                   !8, $28
         31        FREE                                                     ~23
   44    32        INIT_FCALL                                               'token_name'
         33        SEND_VAR                                                 !6
         34        DO_ICALL                                         $30     
         35        ASSIGN                                                   !2, $30
   45    36        ROPE_INIT                                     6  ~33     '%3C'
         37        ROPE_ADD                                      1  ~33     ~33, !6
         38        ROPE_ADD                                      2  ~33     ~33, '%3A'
         39        ROPE_ADD                                      3  ~33     ~33, !2
         40        ROPE_ADD                                      4  ~33     ~33, '%3E'
         41        ROPE_END                                      5  ~32     ~33, !7
         42        ASSIGN_OP                                     8          !4, ~32
         43      > JMP                                                      ->47
   48    44    >   NOP                                                      
         45        FAST_CONCAT                                      ~37     '%3C%2A%3E', !5
         46        ASSIGN_OP                                     8          !4, ~37
   41    47    > > JMP                                                      ->21
         48    >   FE_FREE                                                  $21
   52    49        ECHO                                                     !4
         50      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zh52l
function name:  foo
number of ops:  2
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.27 ms | 1403 KiB | 18 Q