Skip to content

Commit 8621e83

Browse files
etienneroudeixisfedorov
authored andcommitted
Add array_combine thrown exception for php >= 8
1 parent 5282c14 commit 8621e83

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

standard/standard_9.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,27 @@ function array_chunk(array $array, int $length, bool $preserve_keys = false): ar
783783
* @meta
784784
*/
785785
#[Pure]
786-
#[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")]
787-
function array_combine(array $keys, array $values) {}
786+
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')]
787+
function array_combine(array $keys, array $values): array|false {}
788+
789+
/**
790+
* Creates an array by using one array for keys and another for its values
791+
* @link https://php.net/manual/en/function.array-combine.php
792+
* @param array $keys <p>
793+
* Array of keys to be used. Illegal values for key will be
794+
* converted to string.
795+
* </p>
796+
* @param array $values <p>
797+
* Array of values to be used
798+
* </p>
799+
* @return array the combined array
800+
* @throws \ValueError if the number of elements in keys and values does not
801+
* match.
802+
* @meta
803+
*/
804+
#[Pure]
805+
#[PhpStormStubsElementAvailable(from: '8.0')]
806+
function array_combine(array $keys, array $values): array {}
788807

789808
/**
790809
* Checks if the given key or index exists in the array

0 commit comments

Comments
 (0)