Skip to content

Commit b3ed320

Browse files
committed
Bug fix
1 parent 8fe388a commit b3ed320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ArrayFunctions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function slice(array $array, $offset = 0, $limit = 0)
127127
*/
128128
function random(array $array)
129129
{
130-
$index = NumberFunctions\random(0, length($array));
130+
$index = NumberFunctions\random(0, length($array) - 1);
131131

132132
if (isset($array[$index])) {
133133
return $array[$index];

0 commit comments

Comments
 (0)