bug74183.phpt 491 B

123456789101112131415
  1. --TEST--
  2. Bug #74183 - preg_last_error not returning error code after error
  3. --FILE--
  4. <?php
  5. $sRegex = "/([A-Z]|[a-z]|[0-9]| |Ñ|ñ|!|&quot;|%|&amp;|'|´|-|:|;|>|=|&lt;|@|_|,|\{|\}|`|~|á|é|í|ó|ú|Á|É|Í|Ó|Ú|ü|Ü){1,300}/";
  6. $sTest = "Hello world";
  7. var_dump(preg_match($sRegex, $sTest));
  8. var_dump(preg_last_error() === \PREG_INTERNAL_ERROR);
  9. ?>
  10. --EXPECTF--
  11. Warning: preg_match(): Compilation failed: regular expression is too large at offset %s in %s on line %d
  12. bool(false)
  13. bool(true)