1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/pcre/tests/pcre_extra.phpt
Michael Orlitzky bdf62b55bb ext/pcre/tests: support libpcre2-10.47
In the latest version of libpcre2, the offsets appearing in some
"compilation failed" warnings have increased by one, as a result of

  https://github.com/PCRE2Project/pcre2/pull/756

This is causing spurious test failures, so in this commit we replace
the hard-coded offsets by a regex that matches both values.

Gentoo-bug: https://bugs.gentoo.org/965018

Closes GH-20397
2025-11-07 18:52:48 +01:00

16 lines
448 B
PHP

--TEST--
X (PCRE_EXTRA) modifier is ignored (no error, no change)
--FILE--
<?php
var_dump(preg_match('/\y/', '\y'));
var_dump(preg_match('/\y/X', '\y'));
?>
--EXPECTF--
Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset %r(1|2)%r in %spcre_extra.php on line 3
bool(false)
Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset %r(1|2)%r in %spcre_extra.php on line 4
bool(false)