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