3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getHashtags($string) { $hashtags= FALSE; preg_match_all("/(#\w+)/u", $string, $matches); if ($matches) { $hashtagsArray = array_count_values($matches[0]); var_dump($hashtagsArray); $hashtags = array_keys($hashtagsArray); } return $hashtags; } var_export( getHashtags( 'Valid hashtags include: #hashtag #NYC2016 #foo #NYC_2016 #gøypålandet! #foo #bar #cat #cat #cat #cat' ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jVTMa
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_export'
   15     1        INIT_FCALL                                               'gethashtags'
   16     2        SEND_VAL                                                 'Valid+hashtags+include%3A+%23hashtag+%23NYC2016+%23foo+%23NYC_2016+%23g%C3%B8yp%C3%A5landet%21+%23foo+%23bar+%23cat+%23cat+%23cat+%23cat'
   15     3        DO_FCALL                                      0  $0      
   16     4        SEND_VAR                                                 $0
   14     5        DO_ICALL                                                 
   18     6      > RETURN                                                   1

Function gethashtags:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/jVTMa
function name:  getHashtags
number of ops:  22
compiled vars:  !0 = $string, !1 = $hashtags, !2 = $matches, !3 = $hashtagsArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <false>
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%2F%28%23%5Cw%2B%29%2Fu'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    6     7      > JMPZ                                                     !2, ->20
    7     8    >   INIT_FCALL                                               'array_count_values'
          9        FETCH_DIM_R                                      ~6      !2, 0
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !3, $7
    8    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                                 
    9    16        INIT_FCALL                                               'array_keys'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !1, $10
   11    20    > > RETURN                                                   !1
   12    21*     > RETURN                                                   null

End of function gethashtags

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.21 ms | 1009 KiB | 19 Q