3v4l.org

run code in 500+ PHP versions simultaneously
<?php $source = <<<'EOD' <?php class CoveredClassWithAnonymousFunctionInStaticMethod { public static function &runAnonymous() { $filter = ['abc124', 'abc123', "123"]; 123.123; $x, $c = 1; 4 < 4; 3 > 3; 2 + 2; 3 - 3; 3 * 3; 3 / 3; 3 % 3; $x?->y; 4 | 4; @$x; ^$x; ~$z; !$x; `echo 1`; array_walk( $filter, function (&$val, $key) { $val = preg_replace('|[^0-9]|', '', $val); } ); // Should be covered $extravar = true; } } EOD; foreach(PhpToken::tokenize($source) as $token) { $name = $token->getTokenName(); if (strlen($name) == 1) { var_dump($token->getTokenName()); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/bfRMm
function name:  (null)
number of ops:  20
compiled vars:  !0 = $source, !1 = $token, !2 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3C%3Fphp%0A%0Aclass+CoveredClassWithAnonymousFunctionInStaticMethod%0A%7B%0A++++public+static+function+%26runAnonymous%28%29%0A++++%7B%0A++++++++%24filter+%3D+%5B%27abc124%27%2C+%27abc123%27%2C+%22123%22%5D%3B%0A++++++++123.123%3B%0A++++++++%24x%2C+%24c+%3D+1%3B%0A++++++++4+%3C+4%3B%0A++++++++3+%3E+3%3B%0A++++++++2+%2B+2%3B%0A++++++++3+-+3%3B%0A++++++++3+%2A+3%3B%0A++++++++3+%2F+3%3B%0A++++++++3+%25+3%3B%0A++++++++%24x%3F-%3Ey%3B%0A++++++++4+%7C+4%3B%0A++++++++%40%24x%3B%0A++++++++%5E%24x%3B%0A++++++++%7E%24z%3B%0A++++++++%21%24x%3B%0A++++++++%60echo+1%60%3B%0A%0A++++++++array_walk%28%0A++++++++++++%24filter%2C%0A++++++++++++function+%28%26%24val%2C+%24key%29+%7B%0A++++++++++++++++%24val+%3D+preg_replace%28%27%7C%5B%5E0-9%5D%7C%27%2C+%27%27%2C+%24val%29%3B%0A++++++++++++%7D%0A++++++++%29%3B%0A%0A++++++++%2F%2F+Should+be+covered%0A++++++++%24extravar+%3D+true%3B%0A++++%7D%0A%7D'
   41     1        INIT_STATIC_METHOD_CALL                                      'PhpToken', 'tokenize'
          2        SEND_VAR                                                     !0
          3        DO_FCALL                                          0  $4      
          4      > FE_RESET_R                                           $5      $4, ->18
          5    > > FE_FETCH_R                                                   $5, !1, ->18
   42     6    >   INIT_METHOD_CALL                                             !1, 'getTokenName'
          7        DO_FCALL                                          0  $6      
          8        ASSIGN                                                       !2, $6
   43     9        STRLEN                                               ~8      !2
         10        IS_EQUAL                                                     ~8, 1
         11      > JMPZ                                                         ~9, ->17
   44    12    >   INIT_FCALL                                                   'var_dump'
         13        INIT_METHOD_CALL                                             !1, 'getTokenName'
         14        DO_FCALL                                          0  $10     
         15        SEND_VAR                                                     $10
         16        DO_ICALL                                                     
   41    17    > > JMP                                                          ->5
         18    >   FE_FREE                                                      $5
   46    19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
130.41 ms | 478 KiB | 8 Q