3v4l.org

run code in 500+ PHP versions simultaneously
<?php $code = '<?php class Foo { public const NEW = Bar::NEW; }'; foreach (token_get_all($code, TOKEN_PARSE) as $t) { if (is_array($t) && strcasecmp($t[1], 'new') === 0) { echo token_name($t[0]), ' [', $t[1], ']', PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 28
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 28
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 27
Branch analysis from position: 16
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/r4Yni
function name:  (null)
number of ops:  30
compiled vars:  !0 = $code, !1 = $t
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%3C%3Fphp+class+Foo+%7B+public+const+NEW+%3D+Bar%3A%3ANEW%3B+%7D'
    4     1        INIT_FCALL                                                   'token_get_all'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     1
          4        DO_ICALL                                             $3      
          5      > FE_RESET_R                                           $4      $3, ->28
          6    > > FE_FETCH_R                                                   $4, !1, ->28
    5     7    >   TYPE_CHECK                                      128  ~5      !1
          8      > JMPZ_EX                                              ~5      ~5, ->16
          9    >   INIT_FCALL                                                   'strcasecmp'
         10        FETCH_DIM_R                                          ~6      !1, 1
         11        SEND_VAL                                                     ~6
         12        SEND_VAL                                                     'new'
         13        DO_ICALL                                             $7      
         14        IS_IDENTICAL                                         ~8      $7, 0
         15        BOOL                                                 ~5      ~8
         16    > > JMPZ                                                         ~5, ->27
    6    17    >   INIT_FCALL                                                   'token_name'
         18        FETCH_DIM_R                                          ~9      !1, 0
         19        SEND_VAL                                                     ~9
         20        DO_ICALL                                             $10     
         21        ECHO                                                         $10
         22        ECHO                                                         '+%5B'
         23        FETCH_DIM_R                                          ~11     !1, 1
         24        ECHO                                                         ~11
         25        ECHO                                                         '%5D'
         26        ECHO                                                         '%0A'
    4    27    > > JMP                                                          ->6
         28    >   FE_FREE                                                      $4
    8    29      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
146.16 ms | 794 KiB | 11 Q