intelephense

1.14.41.16.1
lib/stub/standard/standard_9.php
lib/stub/standard/standard_9.php
+88−6
Index: package/lib/stub/standard/standard_9.php
===================================================================
--- package/lib/stub/standard/standard_9.php
+++ package/lib/stub/standard/standard_9.php
@@ -203,13 +203,15 @@
 function array_pad(array $array, int $length, mixed $value): array {}
 
 /**
  * Exchanges all keys with their associated values in an array
+ * @template TKey of int|string
+ * @template TValue of int|string
  * @link https://php.net/manual/en/function.array-flip.php
- * @param int[]|string[] $array <p>
+ * @param array<TKey, TValue> $array <p>
  * An array of key/value pairs to be flipped.
  * </p>
- * @return int[]|string[] Returns the flipped array.
+ * @return array<TValue, TKey> Returns the flipped array.
  */
 #[Pure]
 function array_flip(array $array): array {}
 
@@ -462,9 +464,8 @@
  * @return TArray an array containing all the values and keys of
  * array1 that are present in all the arguments.
  * @meta
  */
-#[Pure]
 function array_uintersect_uassoc(
     array $array,
     #[StubsElementAvailable(from: '5.3', to: '7.4')] array $array2,
     #[StubsElementAvailable(from: '5.3', to: '7.4')] callable $data_compare_func,
@@ -729,9 +730,9 @@
  * @template TValue
  * @param array<TKey, TValue> $array <p>
  * The array to iterate over
  * </p>
- * @param (callable(TValue $value): bool)|(callable(TValue $value, TKey $key): bool)|null $callback [optional] <p>
+ * @param ($mode is 1 ? (callable(TValue $value, TKey $key): bool) : ($mode is 2 ? (callable(TKey $key): bool) : (callable(TValue $value): bool)))|null $callback [optional] <p>
  * The callback function to use
  * </p>
  * <p>
  * If no callback is supplied, all entries of
@@ -815,12 +816,31 @@
  * for each array isn't equal or if the arrays are empty.
  * @meta
  */
 #[Pure]
-#[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")]
-function array_combine(array $keys, array $values) {}
+#[StubsElementAvailable(from: '5.3', to: '7.4')]
+function array_combine(array $keys, array $values): array|false {}
 
 /**
+ * Creates an array by using one array for keys and another for its values
+ * @link https://php.net/manual/en/function.array-combine.php
+ * @param array $keys <p>
+ * Array of keys to be used. Illegal values for key will be
+ * converted to string.
+ * </p>
+ * @param array $values <p>
+ * Array of values to be used
+ * </p>
+ * @return array the combined array
+ * @throws \ValueError if the number of elements in keys and values does not
+ * match.
+ * @meta
+ */
+#[Pure]
+#[StubsElementAvailable(from: '8.0')]
+function array_combine(array $keys, array $values): array {}
+
+/**
  * Checks if the given key or index exists in the array
  * @link https://php.net/manual/en/function.array-key-exists.php
  * @param int|string $key <p>
  * Value to check.
@@ -1017,10 +1037,13 @@
  * <p>
  * When using the optional operator argument, the
  * function will return true if the relationship is the one specified
  * by the operator, false otherwise.
+ * @throws ValueError when a non-supported operator is provided.
  */
+#[Pure]
 #[ExpectedValues([-1, 0, 1, false, true])]
+#[StubsElementAvailable(from: '8.0')]
 function version_compare(
     string $version1,
     string $version2,
     #[ExpectedValues(values: [
@@ -1041,8 +1064,67 @@
            ])] ?string $operator
 ): int|bool {}
 
 /**
+ * Compares two "PHP-standardized" version number strings
+ * @link https://php.net/manual/en/function.version-compare.php
+ * @param string $version1 <p>
+ * First version number.
+ * </p>
+ * @param string $version2 <p>
+ * Second version number.
+ * </p>
+ * @param string|null $operator [optional] <p>
+ * If you specify the third optional operator
+ * argument, you can test for a particular relationship. The
+ * possible operators are: &lt;,
+ * lt, &lt;=,
+ * le, &gt;,
+ * gt, &gt;=,
+ * ge, ==,
+ * =, eq,
+ * !=, &lt;&gt;,
+ * ne respectively.
+ * </p>
+ * <p>
+ * This parameter is case-sensitive, so values should be lowercase.
+ * </p>
+ * @return int|bool|null By default, version_compare returns
+ * -1 if the first version is lower than the second,
+ * 0 if they are equal, and
+ * 1 if the second is lower.
+ * </p>
+ * <p>
+ * When using the optional operator argument, the
+ * function will return true if the relationship is the one specified
+ * by the operator, false otherwise.
+ * If a non supported operator is provided, it will return null.
+ */
+#[Pure]
+#[ExpectedValues([-1, 0, 1, false, true, null])]
+#[StubsElementAvailable(to: '7.4')]
+function version_compare(
+    string $version1,
+    string $version2,
+    #[ExpectedValues(values: [
+        "<",
+        "lt",
+        "<=",
+        "le",
+        ">",
+        "gt",
+        ">=",
+        "ge",
+        "==",
+        "=",
+        "eq",
+        "!=",
+        "<>",
+        "ne"
+    ])] ?string $operator
+): int|bool|null {}
+
+/**
  * Convert a pathname and a project identifier to a System V IPC key
  * @link https://php.net/manual/en/function.ftok.php
  * @param string $filename <p>
  * Path to an accessible file.