From 115c60e0bbe0dbe1c0b11db7bf50cf23695f14dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 12 Feb 2024 22:43:34 +0100 Subject: [PATCH] Validate constructor property promotion in stubs --- build/gen_stub.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/gen_stub.php b/build/gen_stub.php index eda2250723ee5..17c58eced23b0 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -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]);