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

Validate constructor property promotion in stubs

This commit is contained in:
Máté Kocsis
2024-02-12 22:43:34 +01:00
parent 20c49f8524
commit 115c60e0bb

View File

@@ -3947,6 +3947,10 @@ function parseFunctionLike(
$numRequiredArgs = 0;
$foundVariadic = false;
foreach ($func->getParams() as $i => $param) {
if ($param->isPromoted()) {
throw new Exception("Promoted properties are not supported");
}
$varName = $param->var->name;
$preferRef = !empty($paramMeta[$varName]['prefer-ref']);
unset($paramMeta[$varName]);