3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tokens = token_get_all(<<<EOP <?php echo strpos('Hello World', 0, -5).'Wouter'; EOP ); var_dump(array_map(function ($token) { return sprintf('Regel %d %s %s', $token[0], trim($token[1]), token_name($token[2])); }, $tokens));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QIEQk
function name:  (null)
number of ops:  13
compiled vars:  !0 = $tokens
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'token_get_all'
    4     1        SEND_VAL                                                 '%3C%3Fphp%0A%0Aecho+strpos%28%27Hello+World%27%2C+0%2C+-5%29.%27Wouter%27%3B'
          2        DO_ICALL                                         $1      
    3     3        ASSIGN                                                   !0, $1
   11     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'array_map'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQIEQk%3A11%240'
   13     7        SEND_VAL                                                 ~3
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQIEQk%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QIEQk
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 'Regel+%25d+%25s+%25s'
          3        FETCH_DIM_R                                      ~1      !0, 0
          4        SEND_VAL                                                 ~1
          5        INIT_FCALL                                               'trim'
          6        FETCH_DIM_R                                      ~2      !0, 1
          7        SEND_VAL                                                 ~2
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        INIT_FCALL                                               'token_name'
         11        FETCH_DIM_R                                      ~4      !0, 2
         12        SEND_VAL                                                 ~4
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                         $6      
         16      > RETURN                                                   $6
   13    17*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQIEQk%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.67 ms | 1396 KiB | 25 Q