1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

gen_stub: fix regexps with unintentional range due to - character placement (#12004)

This commit is contained in:
Ayesh Karunaratne
2023-08-20 20:20:56 +08:00
committed by GitHub
parent 807a05ee55
commit e6627ccb52

View File

@@ -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");