3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tokens = token_get_all(" <?php class Foo { function __halt_compiler(){} } (new Foo())->__halt_compiler(); not_html(); " ); array_walk($tokens, function($tk) { if(is_array($tk)) { if(($t = token_name($tk[0])) == 'T_WHITESPACE') return; echo "L{$tk[2]}: ".$t." {$tk[1]}", PHP_EOL; } else echo $tk, PHP_EOL; });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gm973
function name:  (null)
number of ops:  10
compiled vars:  !0 = $tokens
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'token_get_all'
          1        SEND_VAL                                                 '%0A%3C%3Fphp%0A%0Aclass+Foo+%7B%0A++++function+__halt_compiler%28%29%7B%7D%0A%7D%0A%0A%28new+Foo%28%29%29-%3E__halt_compiler%28%29%3B%0A%0Anot_html%28%29%3B%0A%0A'
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
   16     4        INIT_FCALL                                               'array_walk'
          5        SEND_REF                                                 !0
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fgm973%3A16%240'
   22     7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fgm973%3A16%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gm973
function name:  {closure}
number of ops:  26
compiled vars:  !0 = $tk, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~2, ->23
   18     3    >   INIT_FCALL                                               'token_name'
          4        FETCH_DIM_R                                      ~3      !0, 0
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                         $4      
          7        ASSIGN                                           ~5      !1, $4
          8        IS_EQUAL                                                 ~5, 'T_WHITESPACE'
          9      > JMPZ                                                     ~6, ->11
         10    > > RETURN                                                   null
   19    11    >   ROPE_INIT                                     3  ~9      'L'
         12        FETCH_DIM_R                                      ~7      !0, 2
         13        ROPE_ADD                                      1  ~9      ~9, ~7
         14        ROPE_END                                      2  ~8      ~9, '%3A+'
         15        CONCAT                                           ~11     ~8, !1
         16        NOP                                                      
         17        FETCH_DIM_R                                      ~12     !0, 1
         18        FAST_CONCAT                                      ~13     '+', ~12
         19        CONCAT                                           ~14     ~11, ~13
         20        ECHO                                                     ~14
         21        ECHO                                                     '%0A'
         22      > JMP                                                      ->25
   21    23    >   ECHO                                                     !0
         24        ECHO                                                     '%0A'
   22    25    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fgm973%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.2 ms | 1400 KiB | 19 Q