mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
gen_stub: fix regexps with unintentional range due to -
character placement (#12004)
This commit is contained in:
parent
807a05ee55
commit
e6627ccb52
@ -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…
Reference in New Issue
Block a user