Skip to content

gen_stub: set up PHP 8.5 support #17780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
const PHP_82_VERSION_ID = 80200;
const PHP_83_VERSION_ID = 80300;
const PHP_84_VERSION_ID = 80400;
const PHP_85_VERSION_ID = 80500;
const ALL_PHP_VERSION_IDS = [
PHP_70_VERSION_ID,
PHP_80_VERSION_ID,
PHP_81_VERSION_ID,
PHP_82_VERSION_ID,
PHP_83_VERSION_ID,
PHP_84_VERSION_ID,
PHP_85_VERSION_ID,
];

/**
Expand Down Expand Up @@ -1541,6 +1543,7 @@ private function getArginfoFlagsByPhpVersions(): array
PHP_82_VERSION_ID => $php82AndAboveFlags,
PHP_83_VERSION_ID => $php82AndAboveFlags,
PHP_84_VERSION_ID => $php82AndAboveFlags,
PHP_85_VERSION_ID => $php82AndAboveFlags,
];
}

Expand Down Expand Up @@ -2342,6 +2345,7 @@ protected function getFlagsByPhpVersion(): array
PHP_82_VERSION_ID => [$flags],
PHP_83_VERSION_ID => [$flags],
PHP_84_VERSION_ID => [$flags],
PHP_85_VERSION_ID => [$flags],
];
}

Expand Down Expand Up @@ -2925,6 +2929,12 @@ class PropertyInfo extends VariableLike
"set" => "ZEND_STR_SET",
];

// NEW in 8.5
private const PHP_85_KNOWN = [
"self" => "ZEND_STR_SELF",
"parent" => "ZEND_STR_PARENT",
];

/**
* @var AttributeInfo[] $attributes
*/
Expand Down Expand Up @@ -3068,6 +3078,10 @@ private function getString(string $propName): array {
}
$include = self::PHP_80_KNOWN;
switch ($minPhp) {
case PHP_85_VERSION_ID:
$include = array_merge($include, self::PHP_85_KNOWN);
// Intentional fall through

case PHP_84_VERSION_ID:
$include = array_merge($include, self::PHP_84_KNOWN);
// Intentional fall through
Expand Down Expand Up @@ -3546,6 +3560,7 @@ private function getFlagsByPhpVersion(): array

$php83Flags = $php82Flags;
$php84Flags = $php83Flags;
$php85Flags = $php84Flags;

return [
PHP_70_VERSION_ID => $php70Flags,
Expand All @@ -3554,6 +3569,7 @@ private function getFlagsByPhpVersion(): array
PHP_82_VERSION_ID => $php82Flags,
PHP_83_VERSION_ID => $php83Flags,
PHP_84_VERSION_ID => $php84Flags,
PHP_85_VERSION_ID => $php85Flags,
];
}

Expand Down Expand Up @@ -4930,7 +4946,7 @@ protected function pName_FullyQualified(Name\FullyQualified $node): string {
throw new Exception(
"Legacy PHP version must be one of: \"" . PHP_70_VERSION_ID . "\" (PHP 7.0), \"" . PHP_80_VERSION_ID . "\" (PHP 8.0), " .
"\"" . PHP_81_VERSION_ID . "\" (PHP 8.1), \"" . PHP_82_VERSION_ID . "\" (PHP 8.2), \"" . PHP_83_VERSION_ID . "\" (PHP 8.3), " .
"\"" . PHP_84_VERSION_ID . "\" (PHP 8.4), \"" . $tag->value . "\" provided"
"\"" . PHP_84_VERSION_ID . "\" (PHP 8.4), \"" . PHP_85_VERSION_ID . "\" (PHP 8.5), \"" . $tag->value . "\" provided"
);
}

Expand Down
Loading