diff --git a/.changes/nextrelease/php-8-patch.json b/.changes/nextrelease/php-8-patch.json new file mode 100644 index 0000000000..d8e0c50853 --- /dev/null +++ b/.changes/nextrelease/php-8-patch.json @@ -0,0 +1,7 @@ +[ + { + "type": "bugfix", + "category": "Credentials", + "description": "Fixes a crash in PHP 8.0 by calling array_values on the default chain array passed into self::chain" + } +] diff --git a/src/Credentials/CredentialProvider.php b/src/Credentials/CredentialProvider.php index 252a739119..bda6712c2b 100644 --- a/src/Credentials/CredentialProvider.php +++ b/src/Credentials/CredentialProvider.php @@ -122,7 +122,7 @@ public static function defaultProvider(array $config = []) return self::memoize( call_user_func_array( 'self::chain', - $defaultChain + array_values($defaultChain) ) ); }