3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'foo [abc - def - ghi - jkl] bar'; $regex = <<<REGEX / (?: #start a non-capturing group \[ #match a left square brace (?=[a-z -]+]) #lookahead for the completion of a valid placeholder expression | #or \G(?!^) #continue from end position of last match and not the start of the string \s-\s #match a whitespace, hyphen then a whitespace ) #close the non-capturing group \K #forget any matched characters up to this position [a-z]+ #match one or more lowercase ascii letters /x REGEX; if (preg_match_all($regex, $text, $match)) { var_export($match[0]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/mcpmb
function name:  (null)
number of ops:  13
compiled vars:  !0 = $text, !1 = $regex, !2 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'foo+%5Babc+-+def+-+ghi+-+jkl%5D+bar'
    4     1        ASSIGN                                                   !1, '%2F++++++++++++++++++%0A%28%3F%3A++++++++++++++++%23start+a+non-capturing+group%0A+++%5C%5B++++++++++++++%23match+a+left+square+brace%0A+++%28%3F%3D%5Ba-z+-%5D%2B%5D%29+++%23lookahead+for+the+completion+of+a+valid+placeholder+expression%0A+++%7C+++++++++++++++%23or%0A+++%5CG%28%3F%21%5E%29+++++++++%23continue+from+end+position+of+last+match+and+not+the+start+of+the+string%0A+++%5Cs-%5Cs+++++++++++%23match+a+whitespace%2C+hyphen+then+a+whitespace%0A%29++++++++++++++++++%23close+the+non-capturing+group%0A%5CK+++++++++++++++++%23forget+any+matched+characters+up+to+this+position%0A%5Ba-z%5D%2B+++++++++++++%23match+one+or+more+lowercase+ascii+letters%0A%2Fx'
   17     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->12
   18     8    >   INIT_FCALL                                               'var_export'
          9        FETCH_DIM_R                                      ~6      !2, 0
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
   19    12    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.51 ms | 1002 KiB | 15 Q