PageRenderTime 65ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://github.com/facebook/hiphop-php
PHP | 9 lines | 8 code | 1 blank | 0 comment | 0 complexity | c359d1b75358930ccad16ae746c850e9 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
  2. <<__EntryPoint>> function main(): void {
  3. ini_set('pcre.backtrack_limit', 1);
  4. var_dump(@preg_match_all('/.*\p{N}/', '0123456789'));
  5. var_dump(preg_last_error() === PREG_BACKTRACK_LIMIT_ERROR);
  6. var_dump(preg_match_all('/\p{Nd}/', '0123456789'));
  7. var_dump(preg_last_error() === PREG_NO_ERROR);
  8. }