3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = "@ ^([\\x20\\t]*)/\\*!\\* (?:[\\x20\\t]*(!?\\w*))? # Start with some indent, a comment with the special marker, then an optional name ((?:[^*]|\\*[^/])*) # Any amount of \"a character that isnt a star, or a star not followed by a / \\*/ # The comment end @mx"; $str = "use hafriedlander\Peg\Parser;\n\nclass FQL extends Parser\Basic\n{\n /*!* FQL\n Quote: !'\\''\"'\n Character: /[^\t\n\r\"]/\n Word: w:('\\\"' | Character)+\n function w(&\$res, \$sub) {\n if ( !isset(\$res['val']) ) \$res['val'] = '';\n \$res['val'] .= \$sub['text'];\n }\n FunctionName: w:/ \w+ /\n function w(&\$res, \$sub) {\n if ( !isset(\$res['val']) ) \$res['val'] = '';\n \$res['val'] .= \$sub['text'];\n }\n Connector: c:/ ((a|A)(n|N)(d|D))|((x|X)(o|O)(r|R))|((o|O)(r|R)) /\n function c(&\$res, \$sub) {\n \$res['val'] = strtolower(\$sub['text']);\n }\n Operand: o:/ !((h|H)(a|A)(s|S))|((h|H)(a|A)(s|S))|!((i|I)(n|N))|((i|I)(n|N))|!=|>=|<=|=|<|> /\n function o(&\$res, \$sub) {\n \$res['val'] = strtolower(\$sub['text']);\n }\n ValueAtom: > (Quote atom:Word Quote | emptyAtom:'\"\"') >\n function atom(&\$res, \$sub) {\n \$res['val'] = \$sub['val'];\n }\n function emptyAtom(&\$res, \$sub) {\n \$res['val'] = \"\";\n }\n ValueList: > '[' > atom:ValueAtom (> ',' > rest:ValueAtom)* > ']' >\n function atom(&\$res, \$sub) {\n \$res['val'] = [\$sub['val']];\n }\n function rest(&\$res, \$sub) {\n \$res['val'][] = \$sub['val'];\n }\n ControlAtom: > Quote '#' atom:Word Quote >\n function atom(&\$res, \$sub) {\n \$res['val'] = \$sub['val'];\n }\n ColumnAtom: > Quote > ':' atom:Word Quote >\n function atom(&\$res, \$sub) {\n \$res['val'] = \$sub['val'];\n }\n FunctionAtom: > fnc:FunctionName > '(' atom:ControlAtom (',' > params:ValueAtom >)* ')' >\n function atom(&\$res, \$sub) {\n \$res['val'] = \$sub['val'];\n }\n function fnc(&\$res, \$sub) {\n \$res['fnc'] = strtolower(\$sub['val']);\n \$res['params'] = [];\n }\n function params(&\$res, \$sub) {\n \$res['params'][] = \$sub['val'];\n }\n Assignment: (control:FunctionAtom | control:ControlAtom | control:ColumnAtom) operand:Operand (value:ValueList | value:ValueAtom)\n Block: > ('(' > block:Statement+ > ')') | block:Assignment\n Statement: (left:Block > connector:Connector > right:Statement) | (left:Block > !Connector)\n */\n}"; preg_match($re, $str, $matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UhlP5
function name:  (null)
number of ops:  11
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%40%0A++++++++++++%5E%28%5B%5Cx20%5Ct%5D%2A%29%2F%5C%2A%21%5C%2A+%28%3F%3A%5B%5Cx20%5Ct%5D%2A%28%21%3F%5Cw%2A%29%29%3F+++%23+Start+with+some+indent%2C+a+comment+with+the+special+marker%2C+then+an+optional+name%0A++++++++++++%28%28%3F%3A%5B%5E%2A%5D%7C%5C%2A%5B%5E%2F%5D%29%2A%29+++++++++++++++++++++++++%23+Any+amount+of+%22a+character+that+isnt+a+star%2C+or+a+star+not+followed+by+a+%2F%0A++++++++++++%5C%2A%2F++++++++++++++++++++++++++++++++++++++++%23+The+comment+end%0A++++++++%40mx'
    8     1        ASSIGN                                                   !1, 'use+hafriedlander%5CPeg%5CParser%3B%0A%0Aclass+FQL+extends+Parser%5CBasic%0A%7B%0A++++%2F%2A%21%2A+FQL%0A++++Quote%3A+%21%27%5C%27%27%22%27%0A++++Character%3A+%2F%5B%5E%09%0A%0D%22%5D%2F%0A++++Word%3A+w%3A%28%27%5C%22%27+%7C+Character%29%2B%0A++++++function+w%28%26%24res%2C+%24sub%29+%7B%0A++++++++if+%28+%21isset%28%24res%5B%27val%27%5D%29+%29+%24res%5B%27val%27%5D+%3D+%27%27%3B%0A++++++++%24res%5B%27val%27%5D+.%3D+%24sub%5B%27text%27%5D%3B%0A++++++%7D%0A++++FunctionName%3A+w%3A%2F+%5Cw%2B+%2F%0A++++++function+w%28%26%24res%2C+%24sub%29+%7B%0A++++++++if+%28+%21isset%28%24res%5B%27val%27%5D%29+%29+%24res%5B%27val%27%5D+%3D+%27%27%3B%0A++++++++%24res%5B%27val%27%5D+.%3D+%24sub%5B%27text%27%5D%3B%0A++++++%7D%0A++++Connector%3A+c%3A%2F+%28%28a%7CA%29%28n%7CN%29%28d%7CD%29%29%7C%28%28x%7CX%29%28o%7CO%29%28r%7CR%29%29%7C%28%28o%7CO%29%28r%7CR%29%29+%2F%0A++++++function+c%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D+%3D+strtolower%28%24sub%5B%27text%27%5D%29%3B%0A++++++%7D%0A++++Operand%3A+o%3A%2F+%21%28%28h%7CH%29%28a%7CA%29%28s%7CS%29%29%7C%28%28h%7CH%29%28a%7CA%29%28s%7CS%29%29%7C%21%28%28i%7CI%29%28n%7CN%29%29%7C%28%28i%7CI%29%28n%7CN%29%29%7C%21%3D%7C%3E%3D%7C%3C%3D%7C%3D%7C%3C%7C%3E+%2F%0A++++++function+o%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D+%3D+strtolower%28%24sub%5B%27text%27%5D%29%3B%0A++++++%7D%0A++++ValueAtom%3A+%3E+%28Quote+atom%3AWord+Quote+%7C+emptyAtom%3A%27%22%22%27%29++%3E%0A++++++function+atom%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D+%3D+%24sub%5B%27val%27%5D%3B%0A++++++%7D%0A++++++function+emptyAtom%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D+%3D+%22%22%3B%0A++++++%7D%0A++++ValueList%3A+%3E+%27%5B%27+%3E+atom%3AValueAtom+%28%3E+%27%2C%27+%3E+rest%3AValueAtom%29%2A+%3E+%27%5D%27+%3E%0A++++++function+atom%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D+%3D+%5B%24sub%5B%27val%27%5D%5D%3B%0A++++++%7D%0A++++++function+rest%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D%5B%5D+%3D+%24sub%5B%27val%27%5D%3B%0A++++++%7D%0A++++ControlAtom%3A+%3E+Quote+%27%23%27+atom%3AWord+Quote+%3E%0A++++++function+atom%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D+%3D+%24sub%5B%27val%27%5D%3B%0A++++++%7D%0A++++ColumnAtom%3A+%3E+Quote+%3E+%27%3A%27+atom%3AWord+Quote+%3E%0A++++++function+atom%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D+%3D+%24sub%5B%27val%27%5D%3B%0A++++++%7D%0A++++FunctionAtom%3A+%3E+fnc%3AFunctionName+%3E+%27%28%27+atom%3AControlAtom+%28%27%2C%27+%3E+params%3AValueAtom+%3E%29%2A+%27%29%27+%3E%0A++++++function+atom%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27val%27%5D+%3D+%24sub%5B%27val%27%5D%3B%0A++++++%7D%0A++++++function+fnc%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27fnc%27%5D+%3D+strtolower%28%24sub%5B%27val%27%5D%29%3B%0A++++++++%24res%5B%27params%27%5D+%3D+%5B%5D%3B%0A++++++%7D%0A++++++function+params%28%26%24res%2C+%24sub%29+%7B%0A++++++++%24res%5B%27params%27%5D%5B%5D+%3D+%24sub%5B%27val%27%5D%3B%0A++++++%7D%0A++++Assignment%3A+%28control%3AFunctionAtom+%7C+control%3AControlAtom+%7C+control%3AColumnAtom%29+operand%3AOperand+%28value%3AValueList+%7C+value%3AValueAtom%29%0A++++Block%3A+%3E+%28%27%28%27+%3E+block%3AStatement%2B+%3E+%27%29%27%29+%7C+block%3AAssignment%0A++++Statement%3A+%28left%3ABlock+%3E+connector%3AConnector+%3E+right%3AStatement%29+%7C+%28left%3ABlock+%3E+%21Connector%29%0A++++%2A%2F%0A%7D'
   10     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   12     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.5 ms | 1400 KiB | 17 Q