mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
gen_stub: fix regexps with unintentional range due to -
character placement (#12004)
This commit is contained in:
parent
807a05ee55
commit
e6627ccb52
1 changed files with 1 additions and 1 deletions
|
@ -272,7 +272,7 @@ class SimpleType {
|
|||
}
|
||||
|
||||
$matches = [];
|
||||
$isArray = preg_match("/array\s*<\s*([A-Za-z0-9_-|]+)?(\s*,\s*)?([A-Za-z0-9_-|]+)?\s*>/i", $typeString, $matches);
|
||||
$isArray = preg_match("/array\s*<\s*([A-Za-z0-9_|-]+)?(\s*,\s*)?([A-Za-z0-9_|-]+)?\s*>/i", $typeString, $matches);
|
||||
if ($isArray) {
|
||||
if (empty($matches[1]) || empty($matches[3])) {
|
||||
throw new Exception("array<> type hint must have both a key and a value");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue