intelephense

1.14.41.16.1
lib/stub/standard/standard_8.php
lib/stub/standard/standard_8.php
+31−4
Index: package/lib/stub/standard/standard_8.php
===================================================================
--- package/lib/stub/standard/standard_8.php
+++ package/lib/stub/standard/standard_8.php
@@ -88,8 +88,9 @@
  * return the different JPG APP markers as an associative array. <br>
  * Some programs use these APP markers to embed text information in images. <br>
  * A very common one is to embed » IPTC information in the APP13 marker. <br>
  * You can use the iptcparse() function to parse the binary APP13 marker into something readable.
+ * @param-out array $image_info
  * @return array{0:int, 1:int, 2:int, 3:string, bits:int, channels:int, mime:string}|false Returns an array with 7 elements.<br>
  * Index 0 and 1 contains respectively the width and the height of the image.<br>
  * Index 2 is one of the <b>IMAGETYPE_XXX</b> constants indicating the type of the image.<br>
  * Index 3 is a text string with the correct <b>height="yyy" width="xxx"</b> string<br>
@@ -259,16 +260,18 @@
  * @link https://php.net/manual/en/function.ob-get-length.php
  * @return int|false the length of the output buffer contents or false if no
  * buffering is active.
  */
+#[Pure(true)]
 function ob_get_length(): int|false {}
 
 /**
  * Return the nesting level of the output buffering mechanism
  * @link https://php.net/manual/en/function.ob-get-level.php
  * @return int the level of nested output buffering handlers or zero if output
  * buffering is not active.
  */
+#[Pure(true)]
 function ob_get_level(): int {}
 
 /**
  * Get status of output buffers
@@ -348,8 +351,9 @@
     "chunk_size" => "int",
     "buffer_size" => "int",
     "buffer_used" => "int",
 ])]
+#[Pure(true)]
 function ob_get_status(bool $full_status = false): array {}
 
 /**
  * Return the contents of the output buffer
@@ -382,9 +386,9 @@
  */
 function ob_list_handlers(): array {}
 
 /**
- * Sort an array by key
+ * Sort an array by key in ascending order
  * @link https://php.net/manual/en/function.ksort.php
  * @param array &$array <p>
  * The input array.
  * </p>
@@ -959,14 +963,15 @@
  * In other words, the sort is lexicographical.
  * </p>
  * @return bool true on success or false on failure.
  */
+#[LanguageLevelTypeAware(['8.5' => 'true'], default: 'bool')]
 function array_multisort(
     &$array,
     #[StubsElementAvailable(from: '5.3', to: '7.4')] $sort_order = SORT_ASC,
     #[StubsElementAvailable(from: '5.3', to: '7.4')] $sort_flags = SORT_REGULAR,
     &...$rest
-): bool {}
+) {}
 
 /**
  * Push elements onto the end of array
  * Since 7.3.0 this function can be called with only one parameter.
@@ -1071,9 +1076,9 @@
  * around it, unless the element is an array itself.
  * </p>
  * @return array the array consisting of the extracted elements.
  */
-function array_splice(array &$array, int $offset, ?int $length, mixed $replacement = []): array {}
+function array_splice(array &$array, int $offset, ?int $length = null, mixed $replacement = []): array {}
 
 /**
  * Extract a slice of the array
  * @link https://php.net/manual/en/function.array-slice.php
@@ -1104,9 +1109,9 @@
  * @return TArray the slice.
  * @meta
  */
 #[Pure]
-function array_slice(array $array, int $offset, ?int $length, bool $preserve_keys = false): array {}
+function array_slice(array $array, int $offset, ?int $length = null, bool $preserve_keys = false): array {}
 
 /**
  * Merges the elements of one or more arrays together (if the input arrays have the same string keys, then the later value for that key will overwrite the previous one; if the arrays contain numeric keys, the later value will be appended)
  * Since 7.4.0 this function can be called without any parameter, and it will return empty array.
@@ -1123,4 +1128,26 @@
     #[StubsElementAvailable(from: '5.3', to: '7.3')] $array,
     #[StubsElementAvailable(from: '5.3', to: '7.0')] $arrays,
     array ...$arrays
 ): array {}
+
+/**
+ * @template TKey
+ * @template TValue
+ * @param array<TKey, TValue> $array
+ * @return TValue|null
+ * @since 8.5
+ * @meta
+ */
+#[Pure]
+function array_first(array $array): mixed {}
+
+/**
+ * @template TKey
+ * @template TValue
+ * @param array<TKey, TValue> $array
+ * @return TValue|null
+ * @since 8.5
+ * @meta
+ */
+#[Pure]
+function array_last(array $array): mixed {}