3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string= "Hi #geeting #shortAnswer #notUseful"; preg_match_all('/#(\w+)/',$string, $matches); echo "The matches:\n"; foreach ($matches[1] as $tag) { echo $tag."\n"; } echo "\n\nThe array \$matches:\n"; var_dump($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/mBlW5
function name:  (null)
number of ops:  19
compiled vars:  !0 = $string, !1 = $matches, !2 = $tag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Hi+%23geeting+%23shortAnswer+%23notUseful'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%23%28%5Cw%2B%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    6     6        ECHO                                                     'The+matches%3A%0A'
    8     7        FETCH_DIM_R                                      ~5      !1, 1
          8      > FE_RESET_R                                       $6      ~5, ->13
          9    > > FE_FETCH_R                                               $6, !2, ->13
    9    10    >   CONCAT                                           ~7      !2, '%0A'
         11        ECHO                                                     ~7
    8    12      > JMP                                                      ->9
         13    >   FE_FREE                                                  $6
   12    14        ECHO                                                     '%0A%0AThe+array+%24matches%3A%0A'
   14    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.52 ms | 1395 KiB | 17 Q