Note that the order of returned keys is deterministic

Patch contributed by Larry Garfield <larry@garfieldtech.com>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350939 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2020-10-19 07:35:23 +00:00
parent ca309ab744
commit 282140eb7d

View file

@ -48,7 +48,9 @@
When picking only one entry, <function>array_rand</function> returns
the key for a random entry. Otherwise, an array of keys for the random
entries is returned. This is done so that random keys can be picked
from the array as well as random values. Trying to pick more elements
from the array as well as random values. If multiple keys are returned,
they will be returned in the order they were present in the original array.
Trying to pick more elements
than there are in the array will result in an
<constant>E_WARNING</constant> level error, and NULL will be returned.
</para>