PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/bad/ext/pcre/tests/marks.php

http://github.com/facebook/hiphop-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
  1. <?php
  2. $regex = <<<'REGEX'
  3. /
  4. _ (a) (*MARK:A_MARK) _
  5. | _ (b) _
  6. | _ (c) (*MARK:C_MARK) _
  7. | _ (d) _
  8. /x
  9. REGEX;
  10. var_dump(preg_match($regex, '_c_', $matches));
  11. var_dump($matches);
  12. var_dump(preg_match_all($regex, '_a__b__c__d_', $matches, PREG_PATTERN_ORDER));
  13. var_dump($matches);
  14. var_dump(preg_match_all($regex, '_a__b__c__d_', $matches, PREG_SET_ORDER));
  15. var_dump($matches);
  16. var_dump(preg_replace_callback($regex, function($matches) {
  17. var_dump($matches);
  18. return $matches[0];
  19. }, '_a__b__c__d_'));
  20. ?>