Skip to content

Commit efecd13

Browse files
gen_stub: set up PHP 8.6 support (#21792)
Add the new known string from #20951
1 parent 0236667 commit efecd13

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

build/gen_stub.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
const PHP_83_VERSION_ID = 80300;
2727
const PHP_84_VERSION_ID = 80400;
2828
const PHP_85_VERSION_ID = 80500;
29+
const PHP_86_VERSION_ID = 80600;
2930
const ALL_PHP_VERSION_IDS = [
3031
PHP_70_VERSION_ID,
3132
PHP_80_VERSION_ID,
@@ -34,6 +35,7 @@
3435
PHP_83_VERSION_ID,
3536
PHP_84_VERSION_ID,
3637
PHP_85_VERSION_ID,
38+
PHP_86_VERSION_ID,
3739
];
3840

3941
// file_put_contents() but with a success message printed after saving
@@ -2921,6 +2923,11 @@ class StringBuilder {
29212923
'8.5' => 'ZEND_STR_8_DOT_5',
29222924
];
29232925

2926+
// NEW in 8.6
2927+
private const PHP_86_KNOWN = [
2928+
"arguments" => "ZEND_STR_ARGUMENTS",
2929+
];
2930+
29242931
/**
29252932
* Get an array of three strings:
29262933
* - declaration of zend_string, if needed, or empty otherwise
@@ -2959,6 +2966,10 @@ public static function getString(
29592966
}
29602967
$include = self::PHP_80_KNOWN;
29612968
switch ($minPhp) {
2969+
case PHP_86_VERSION_ID:
2970+
$include = array_merge($include, self::PHP_86_KNOWN);
2971+
// Intentional fall through
2972+
29622973
case PHP_85_VERSION_ID:
29632974
$include = array_merge($include, self::PHP_85_KNOWN);
29642975
// Intentional fall through
@@ -4148,7 +4159,8 @@ public function __construct(array $fileTags) {
41484159
throw new Exception(
41494160
"Legacy PHP version must be one of: \"" . PHP_70_VERSION_ID . "\" (PHP 7.0), \"" . PHP_80_VERSION_ID . "\" (PHP 8.0), " .
41504161
"\"" . PHP_81_VERSION_ID . "\" (PHP 8.1), \"" . PHP_82_VERSION_ID . "\" (PHP 8.2), \"" . PHP_83_VERSION_ID . "\" (PHP 8.3), " .
4151-
"\"" . PHP_84_VERSION_ID . "\" (PHP 8.4), \"" . PHP_85_VERSION_ID . "\" (PHP 8.5), \"" . $tag->value . "\" provided"
4162+
"\"" . PHP_84_VERSION_ID . "\" (PHP 8.4), \"" . PHP_85_VERSION_ID . "\" (PHP 8.5), \"" . PHP_86_VERSION_ID . "\" (PHP 8.6), " .
4163+
$tag->value . "\" provided"
41524164
);
41534165
}
41544166

0 commit comments

Comments
 (0)