php-8.0.30-src/ext/pcre/tests/bug74183.phpt

16 lines
491 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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