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); $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/ELRXA
function name:  (null)
number of ops:  16
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                                                 
    7     6        INIT_FCALL                                               'implode'
          7        SEND_VAL                                                 '%2C'
          8        FETCH_DIM_R                                      ~5      !1, 1
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
    9    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.46 ms | 1394 KiB | 19 Q