3v4l.org

run code in 300+ PHP versions simultaneously
<?php $grid_id_unique_name = 'vc_gid'; $pattern = getShortcodeRegexForId(); var_dump($pattern[10]); $content = '[hello]'; preg_match_all( "/$pattern/", $content, $found ); function getShortcodeRegexForId() { return '\\[' // Opening bracket . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]] . '([\\w-_]+)' // 2: Shortcode name . '(?![\\w-])' // Not followed by word character or hyphen . '(' // 3: Unroll the loop: Inside the opening shortcode tag . '[^\\]\\/]*' // Not a closing bracket or forward slash . '(?:' . '\\/(?!\\])' // A forward slash not followed by a closing bracket . '[^\\]\\/]*' // Not a closing bracket or forward slash . ')*?' . '(?:' . '(' . 'vic_gid' // 4: GridId must exist . '[^\\]\\/]*' // Not a closing bracket or forward slash . ')+' . ')' . ')' . '(?:' . '(\\/)' // 5: Self closing tag ... . '\\]' // ... and closing bracket . '|' . '\\]' // Closing bracket . '(?:' . '(' // 6: Unroll the loop: Optionally, anything between the opening and closing shortcode tags . '[^\\[]*+' // Not an opening bracket . '(?:' . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag . '[^\\[]*+' // Not an opening bracket . ')*+' . ')' . '\\[\\/\\2\\]' // Closing shortcode tag . ')?' . ')' . '(\\]?)'; // 7: Optional second closing brocket for escaping shortcodes: [[tag]] }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fRGb0
function name:  (null)
number of ops:  18
compiled vars:  !0 = $grid_id_unique_name, !1 = $pattern, !2 = $content, !3 = $found
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'vc_gid'
    4     1        INIT_FCALL_BY_NAME                                       'getShortcodeRegexForId'
          2        DO_FCALL                                      0  $5      
          3        ASSIGN                                                   !1, $5
    5     4        INIT_FCALL                                               'var_dump'
          5        FETCH_DIM_R                                      ~7      !1, 10
          6        SEND_VAL                                                 ~7
          7        DO_ICALL                                                 
    6     8        ASSIGN                                                   !2, '%5Bhello%5D'
    7     9        INIT_FCALL                                               'preg_match_all'
         10        ROPE_INIT                                     3  ~11     '%2F'
         11        ROPE_ADD                                      1  ~11     ~11, !1
         12        ROPE_END                                      2  ~10     ~11, '%2F'
         13        SEND_VAL                                                 ~10
         14        SEND_VAR                                                 !2
         15        SEND_REF                                                 !3
         16        DO_ICALL                                                 
   33    17      > RETURN                                                   1

Function getshortcoderegexforid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fRGb0
function name:  getShortcodeRegexForId
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E > > RETURN                                                   '%5C%5B%28%5C%5B%3F%29%28%5B%5Cw-_%5D%2B%29%28%3F%21%5B%5Cw-%5D%29%28%5B%5E%5C%5D%5C%2F%5D%2A%28%3F%3A%5C%2F%28%3F%21%5C%5D%29%5B%5E%5C%5D%5C%2F%5D%2A%29%2A%3F%28%3F%3A%28vic_gid%5B%5E%5C%5D%5C%2F%5D%2A%29%2B%29%29%28%3F%3A%28%5C%2F%29%5C%5D%7C%5C%5D%28%3F%3A%28%5B%5E%5C%5B%5D%2A%2B%28%3F%3A%5C%5B%28%3F%21%5C%2F%5C2%5C%5D%29%5B%5E%5C%5B%5D%2A%2B%29%2A%2B%29%5C%5B%5C%2F%5C2%5C%5D%29%3F%29%28%5C%5D%3F%29'
   33     1*     > RETURN                                                   null

End of function getshortcoderegexforid

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.67 ms | 1400 KiB | 17 Q