Skip to content

Commit 6e31850

Browse files
gen_stub: set up PHP 8.5 support (#17780)
Add the new known strings from #17755
1 parent c3b4359 commit 6e31850

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

build/gen_stub.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525
const PHP_82_VERSION_ID = 80200;
2626
const PHP_83_VERSION_ID = 80300;
2727
const PHP_84_VERSION_ID = 80400;
28+
const PHP_85_VERSION_ID = 80500;
2829
const ALL_PHP_VERSION_IDS = [
2930
PHP_70_VERSION_ID,
3031
PHP_80_VERSION_ID,
3132
PHP_81_VERSION_ID,
3233
PHP_82_VERSION_ID,
3334
PHP_83_VERSION_ID,
3435
PHP_84_VERSION_ID,
36+
PHP_85_VERSION_ID,
3537
];
3638

3739
/**
@@ -1541,6 +1543,7 @@ private function getArginfoFlagsByPhpVersions(): array
15411543
PHP_82_VERSION_ID => $php82AndAboveFlags,
15421544
PHP_83_VERSION_ID => $php82AndAboveFlags,
15431545
PHP_84_VERSION_ID => $php82AndAboveFlags,
1546+
PHP_85_VERSION_ID => $php82AndAboveFlags,
15441547
];
15451548
}
15461549

@@ -2342,6 +2345,7 @@ protected function getFlagsByPhpVersion(): array
23422345
PHP_82_VERSION_ID => [$flags],
23432346
PHP_83_VERSION_ID => [$flags],
23442347
PHP_84_VERSION_ID => [$flags],
2348+
PHP_85_VERSION_ID => [$flags],
23452349
];
23462350
}
23472351

@@ -2925,6 +2929,12 @@ class PropertyInfo extends VariableLike
29252929
"set" => "ZEND_STR_SET",
29262930
];
29272931

2932+
// NEW in 8.5
2933+
private const PHP_85_KNOWN = [
2934+
"self" => "ZEND_STR_SELF",
2935+
"parent" => "ZEND_STR_PARENT",
2936+
];
2937+
29282938
/**
29292939
* @var AttributeInfo[] $attributes
29302940
*/
@@ -3068,6 +3078,10 @@ private function getString(string $propName): array {
30683078
}
30693079
$include = self::PHP_80_KNOWN;
30703080
switch ($minPhp) {
3081+
case PHP_85_VERSION_ID:
3082+
$include = array_merge($include, self::PHP_85_KNOWN);
3083+
// Intentional fall through
3084+
30713085
case PHP_84_VERSION_ID:
30723086
$include = array_merge($include, self::PHP_84_KNOWN);
30733087
// Intentional fall through
@@ -3546,6 +3560,7 @@ private function getFlagsByPhpVersion(): array
35463560

35473561
$php83Flags = $php82Flags;
35483562
$php84Flags = $php83Flags;
3563+
$php85Flags = $php84Flags;
35493564

35503565
return [
35513566
PHP_70_VERSION_ID => $php70Flags,
@@ -3554,6 +3569,7 @@ private function getFlagsByPhpVersion(): array
35543569
PHP_82_VERSION_ID => $php82Flags,
35553570
PHP_83_VERSION_ID => $php83Flags,
35563571
PHP_84_VERSION_ID => $php84Flags,
3572+
PHP_85_VERSION_ID => $php85Flags,
35573573
];
35583574
}
35593575

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

0 commit comments

Comments
 (0)