diff --git a/build/gen_stub.php b/build/gen_stub.php index ce1a23866610..5230ef78ef77 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -2375,8 +2375,8 @@ protected function getTypeCode(string $variableLikeName, string &$code): string $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->num_types = $classTypeCount;\n"; foreach ($arginfoType->classTypes as $k => $classType) { - $escapedClassName = $classType->toEscapedName(); - $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$escapedClassName}, 0, 0);\n"; + $varEscapedClassName = $classType->toVarEscapedName(); + $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$varEscapedClassName}, 0, 0);\n"; } $typeMaskCode = $this->type->toArginfoType()->toTypeMask(); @@ -4387,6 +4387,11 @@ private function handleStatements(array $stmts, PrettyPrinterAbstract $prettyPri } } + if ($stmt instanceof Stmt\Use_ || $stmt instanceof Stmt\GroupUse) { + // use statements are resolved by NameResolver before this point + continue; + } + throw new Exception("Unexpected node {$stmt->getType()}"); } if (!empty($conds)) {