mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/pcre: drop negative-length match tests
Newer PCRE2 rejects \K in lookarounds at compile time, so the negative-length match code path can no longer be triggered from userland PHP. The PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK flag that would re-enable it is only settable via the C compile context API.
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
preg_match_all() resource cleanup when \K in lookahead causes negative-length match
|
||||
--FILE--
|
||||
<?php
|
||||
$result = preg_match_all('/(?=ab\K)a/', 'ab', $matches);
|
||||
var_dump($result);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: preg_match_all(): Compilation failed: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK) at offset %d in %s
|
||||
bool(false)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
preg_match() resource cleanup when \K in lookahead causes negative-length match
|
||||
--FILE--
|
||||
<?php
|
||||
$result = preg_match('/(?=ab\K)a/', 'ab', $matches);
|
||||
var_dump($result);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: preg_match(): Compilation failed: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK) at offset %d in %s
|
||||
bool(false)
|
||||
Reference in New Issue
Block a user