3v4l.org

run code in 300+ PHP versions simultaneously
<?php preg_match_all( '#\[(link)(.*?)!?\](.*?)\[\/\\1\]#i', '[link href="http://www.google.com" title="Google" target="_blank"]Google[/link] [link href="http://www.facebook.com"]Facebook[/link] [link href=\'http://www.twitter.com\' rel="nofollow"]Twitter[/link]', $StrMatches ); /* $StrMatches[0] = Full tag string * $StrMatches[1] = Tag name * $StrMatches[2] = tag params string * $StrMatches[3] = Tag content * */ print_r($StrMatches); $ParamList = array(); foreach ($StrMatches[2] as $TagParamStr ) { preg_match_all('#\s*([^=]+)=[\'|"]([^\'|"]*)[\'|"]#', $TagParamStr, $ParamMatches); array_push($ParamList, $ParamMatches); } /* $ParamList[0] = Full param string * $ParamList[1] = Param name * $ParamList[2] = Param value * */ print_r($ParamList);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/HSDvV
function name:  (null)
number of ops:  27
compiled vars:  !0 = $StrMatches, !1 = $ParamList, !2 = $TagParamStr, !3 = $ParamMatches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'preg_match_all'
    3     1        SEND_VAL                                                 '%23%5C%5B%28link%29%28.%2A%3F%29%21%3F%5C%5D%28.%2A%3F%29%5C%5B%5C%2F%5C1%5C%5D%23i'
    4     2        SEND_VAL                                                 '%5Blink+href%3D%22http%3A%2F%2Fwww.google.com%22+title%3D%22Google%22+target%3D%22_blank%22%5DGoogle%5B%2Flink%5D%0A+++++%5Blink+href%3D%22http%3A%2F%2Fwww.facebook.com%22%5DFacebook%5B%2Flink%5D%0A+++++%5Blink+href%3D%27http%3A%2F%2Fwww.twitter.com%27+rel%3D%22nofollow%22%5DTwitter%5B%2Flink%5D'
    7     3        SEND_REF                                                 !0
          4        DO_ICALL                                                 
   15     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   18     8        ASSIGN                                                   !1, <array>
   20     9        FETCH_DIM_R                                      ~7      !0, 2
         10      > FE_RESET_R                                       $8      ~7, ->22
         11    > > FE_FETCH_R                                               $8, !2, ->22
   22    12    >   INIT_FCALL                                               'preg_match_all'
         13        SEND_VAL                                                 '%23%5Cs%2A%28%5B%5E%3D%5D%2B%29%3D%5B%27%7C%22%5D%28%5B%5E%27%7C%22%5D%2A%29%5B%27%7C%22%5D%23'
         14        SEND_VAR                                                 !2
         15        SEND_REF                                                 !3
         16        DO_ICALL                                                 
   23    17        INIT_FCALL                                               'array_push'
         18        SEND_REF                                                 !1
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
   20    21      > JMP                                                      ->11
         22    >   FE_FREE                                                  $8
   30    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.21 ms | 1396 KiB | 19 Q