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

/hphp/test/zend/good/ext/pcre/tests/bug41638.php

http://github.com/facebook/hiphop-php
PHP | 26 lines | 25 code | 1 blank | 0 comment | 0 complexity | 7021d9cbb9e7237afa8e82ab9092998a 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. <?hh <<__EntryPoint>> function main(): void {
  2. $str = "repeater id='loopt' dataSrc=subject colums=2";
  3. $str_instead = null;
  4. preg_match_all_with_matches(
  5. "/(['\"])((.*(\\\\\\1)*)*)\\1/sU",
  6. $str,
  7. inout $str_instead,
  8. );
  9. print_r($str_instead);
  10. // these two are from Magnus Holmgren (extracted from a pcre-dev mailing list post)
  11. preg_match_all_with_matches(
  12. "/(['\"])((?:\\\\\\1|.)*)\\1/sU",
  13. $str,
  14. inout $str_instead,
  15. );
  16. print_r($str_instead);
  17. preg_match_all_with_matches(
  18. "/(['\"])(.*)(?<!\\\\)\\1/sU",
  19. $str,
  20. inout $str_instead,
  21. );
  22. print_r($str_instead);
  23. }