Skip to content

Commit 19bc5e6

Browse files
gen_stub: set up PHP 8.6 support
Add the new known string from #20951
1 parent fa5ab4f commit 19bc5e6

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
@@ -2900,6 +2902,11 @@ class StringBuilder {
29002902
'8.5' => 'ZEND_STR_8_DOT_5',
29012903
];
29022904

2905+
// NEW in 8.6
2906+
private const PHP_86_KNOWN = [
2907+
"arguments" => "ZEND_STR_ARGUMENTS",
2908+
];
2909+
29032910
/**
29042911
* Get an array of three strings:
29052912
* - declaration of zend_string, if needed, or empty otherwise
@@ -2938,6 +2945,10 @@ public static function getString(
29382945
}
29392946
$include = self::PHP_80_KNOWN;
29402947
switch ($minPhp) {
2948+
case PHP_86_VERSION_ID:
2949+
$include = array_merge($include, self::PHP_86_KNOWN);
2950+
// Intentional fall through
2951+
29412952
case PHP_85_VERSION_ID:
29422953
$include = array_merge($include, self::PHP_85_KNOWN);
29432954
// Intentional fall through
@@ -4127,7 +4138,8 @@ public function __construct(array $fileTags) {
41274138
throw new Exception(
41284139
"Legacy PHP version must be one of: \"" . PHP_70_VERSION_ID . "\" (PHP 7.0), \"" . PHP_80_VERSION_ID . "\" (PHP 8.0), " .
41294140
"\"" . PHP_81_VERSION_ID . "\" (PHP 8.1), \"" . PHP_82_VERSION_ID . "\" (PHP 8.2), \"" . PHP_83_VERSION_ID . "\" (PHP 8.3), " .
4130-
"\"" . PHP_84_VERSION_ID . "\" (PHP 8.4), \"" . PHP_85_VERSION_ID . "\" (PHP 8.5), \"" . $tag->value . "\" provided"
4141+
"\"" . PHP_84_VERSION_ID . "\" (PHP 8.4), \"" . PHP_85_VERSION_ID . "\" (PHP 8.5), \"" . PHP_86_VERSION_ID . "\" (PHP 8.6), " .
4142+
$tag->value . "\" provided"
41314143
);
41324144
}
41334145

0 commit comments

Comments
 (0)