3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '#helloworld #test #video #youtube Bon Iver are the best daily surprise :D'; preg_match_all('/#([^\s]+)/', $str, $matches); echo '<pre>'; print_r($matches); $hashtags = implode(',', $matches[1]); var_dump($hashtags);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WOSOO
function name:  (null)
number of ops:  20
compiled vars:  !0 = $str, !1 = $matches, !2 = $hashtags
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%23helloworld+%23test+%23video+%23youtube+Bon+Iver+are+the+best+daily+surprise+%3AD'
    5     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%23%28%5B%5E%5Cs%5D%2B%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    6     6        ECHO                                                     '%3Cpre%3E'
          7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'implode'
         11        SEND_VAL                                                 '%2C'
         12        FETCH_DIM_R                                      ~6      !1, 1
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !2, $7
   10    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.75 ms | 1395 KiB | 21 Q