3v4l.org

run code in 300+ PHP versions simultaneously
<?php $comment = <<<COMMENT #@+ This is a summary. This is a description. COMMENT; // clears all extra horizontal whitespace from the line endings // to prevent parsing issues $comment = preg_replace('/\h*$/Sum', '', $comment); /* * Splits the docblock into a short description, long description and * tags section * - The short description is started from the first character until * a dot is encountered followed by a newline OR * two consecutive newlines (horizontal whitespace is taken into * account to consider spacing errors) * - The long description, any character until a new line is * encountered followed by an @ and word characters (a tag). * This is optional. * - Tags; the remaining characters * * Big thanks to RichardJ for contributing this Regular Expression */ preg_match( '/ (\#\@\+|\#\@\-)? \A ( [^\n.]+ (?: (?! \. \n | \n{2} ) # disallow the first seperator here [\n.] (?! [ \t]* @\pL ) # disallow second seperator [^\n.]+ )* \.? ) (?: \s* # first seperator (actually newlines but it\'s all whitespace) (?! @\pL ) # disallow the rest, to make sure this one doesn\'t match, #if it doesn\'t exist ( [^\n]+ (?: \n+ (?! [ \t]* @\pL ) # disallow second seperator (@param) [^\n]+ )* ) )? (\s+ [\s\S]*)? # everything that follows /ux', $comment, $matches ); array_shift($matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2YLYU
function name:  (null)
number of ops:  19
compiled vars:  !0 = $comment, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%23%40%2B%0AThis+is+a+summary.%0AThis+is+a+description.'
    9     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5Ch%2A%24%2FSum'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
   25     7        INIT_FCALL                                               'preg_match'
   26     8        SEND_VAL                                                 '%2F%0A++++++++%28%5C%23%5C%40%5C%2B%7C%5C%23%5C%40%5C-%29%3F%0A++++++++%5CA+%28%0A++++++++++%5B%5E%5Cn.%5D%2B%0A++++++++++%28%3F%3A%0A++++++++++++%28%3F%21+%5C.+%5Cn+%7C+%5Cn%7B2%7D+%29+%23+disallow+the+first+seperator+here%0A++++++++++++%5B%5Cn.%5D+%28%3F%21+%5B+%5Ct%5D%2A+%40%5CpL+%29+%23+disallow+second+seperator%0A++++++++++++%5B%5E%5Cn.%5D%2B%0A++++++++++%29%2A%0A++++++++++%5C.%3F%0A++++++++%29%0A++++++++%28%3F%3A%0A++++++++++%5Cs%2A+%23+first+seperator+%28actually+newlines+but+it%27s+all+whitespace%29%0A++++++++++%28%3F%21+%40%5CpL+%29+%23+disallow+the+rest%2C+to+make+sure+this+one+doesn%27t+match%2C%0A++++++++++%23if+it+doesn%27t+exist%0A++++++++++%28%0A++++++++++++%5B%5E%5Cn%5D%2B%0A++++++++++++%28%3F%3A+%5Cn%2B%0A++++++++++++++%28%3F%21+%5B+%5Ct%5D%2A+%40%5CpL+%29+%23+disallow+second+seperator+%28%40param%29%0A++++++++++++++%5B%5E%5Cn%5D%2B%0A++++++++++++%29%2A%0A++++++++++%29%0A++++++++%29%3F%0A++++++++%28%5Cs%2B+%5B%5Cs%5CS%5D%2A%29%3F+%23+everything+that+follows%0A++++++++%2Fux'
   51     9        SEND_VAR                                                 !0
   52    10        SEND_REF                                                 !1
         11        DO_ICALL                                                 
   54    12        INIT_FCALL                                               'array_shift'
         13        SEND_REF                                                 !1
         14        DO_ICALL                                                 
   55    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.35 ms | 1395 KiB | 21 Q