diff --git a/ext/readline/readline.stub.php b/ext/readline/readline.stub.php index 64b433a943a..ba157b54e4d 100644 --- a/ext/readline/readline.stub.php +++ b/ext/readline/readline.stub.php @@ -1,7 +1,7 @@ getMessage()} while processing $stubFile\n"; + echo "In $stubFile:\n{$e->getMessage()}\n"; exit(1); } } @@ -230,6 +231,14 @@ function parseFunctionLike(string $name, Node\FunctionLike $func, ?string $cond) throw new Exception("Error in function $name: only the last parameter can be variadic"); } + if ($param->default instanceof Expr\ConstFetch && + $param->default->name->toLowerString() === "null" && + $param->type && !($param->type instanceof Node\NullableType) + ) { + throw new Exception( + "Parameter $varName of function $name has null default, but is not nullable"); + } + $foundVariadic = $param->variadic; $args[] = new ArgInfo(