/hphp/test/zend/bad/ext/pcre/tests/marks.php
PHP | 26 lines | 20 code | 6 blank | 0 comment | 0 complexity | 29fbf52a2328c72657410de914455639 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?php
- $regex = <<<'REGEX'
- /
- _ (a) (*MARK:A_MARK) _
- | _ (b) _
- | _ (c) (*MARK:C_MARK) _
- | _ (d) _
- /x
- REGEX;
- var_dump(preg_match($regex, '_c_', $matches));
- var_dump($matches);
- var_dump(preg_match_all($regex, '_a__b__c__d_', $matches, PREG_PATTERN_ORDER));
- var_dump($matches);
- var_dump(preg_match_all($regex, '_a__b__c__d_', $matches, PREG_SET_ORDER));
- var_dump($matches);
- var_dump(preg_replace_callback($regex, function($matches) {
- var_dump($matches);
- return $matches[0];
- }, '_a__b__c__d_'));
- ?>