reference/array/functions/shuffle.xml
f781803449007bb0e3a96c693e0eee067f7eb466
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xml:id="function.shuffle" xmlns="http://docbook.org/ns/docbook">
3
+
<refentry xml:id="function.shuffle" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
4
<refnamediv>
5
5
<refname>shuffle</refname>
6
6
<refpurpose>Shuffle an array</refpurpose>
...
...
@@ -8,15 +8,13 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>bool</type><methodname>shuffle</methodname>
11
+
<type>true</type><methodname>shuffle</methodname>
12
12
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
13
13
</methodsynopsis>
14
14
<para>
15
15
This function shuffles (randomizes the order of the elements in) an array.
16
-
It uses a pseudo random number generator that is not suitable for
17
-
cryptographic purposes.
18
16
</para>
19
-
&note.sort-unstable;
17
+
&caution.cryptographically-insecure;
20
18
</refsect1>
21
19
<refsect1 role="parameters">
22
20
&reftitle.parameters;
...
...
@@ -36,9 +34,33 @@
36
34
<refsect1 role="returnvalues">
37
35
&reftitle.returnvalues;
38
36
<para>
39
-
&return.success;
37
+
&return.true.always;
40
38
</para>
41
39
</refsect1>
40
+
<refsect1 role="changelog">
41
+
&reftitle.changelog;
42
+
<para>
43
+
<informaltable>
44
+
<tgroup cols="2">
45
+
<thead>
46
+
<row>
47
+
<entry>&Version;</entry>
48
+
<entry>&Description;</entry>
49
+
</row>
50
+
</thead>
51
+
<tbody>
52
+
<row>
53
+
<entry>7.1.0</entry>
54
+
<entry>
55
+
The internal randomization algorithm <link linkend="migration71.incompatible.rand-srand-aliases">has been changed</link> to use the <link xlink:href="&url.mersenne;">Mersenne Twister</link> Random Number Generator instead of the libc rand function.
56
+
</entry>
57
+
</row>
58
+
</tbody>
59
+
</tgroup>
60
+
</informaltable>
61
+
</para>
62
+
</refsect1>
63
+

42
64
<refsect1 role="examples">
43
65
&reftitle.examples;
44
66
<para>
...
...
@@ -61,18 +83,20 @@ foreach ($numbers as $number) {
61
83
<refsect1 role="notes">
62
84
&reftitle.notes;
63
85
&note.no-key-association;
86
+
&note.reset-index;
64
87
</refsect1>
65
88
<refsect1 role="seealso">
66
89
&reftitle.seealso;
67
90
<para>
68
91
<simplelist>
69
-
<member><function>array_rand</function></member>
92
+
<member><function>Random\Randomizer::shuffleArray</function></member>
93
+
<member><function>Random\Randomizer::shuffleBytes</function></member>
94
+
<member><function>Random\Randomizer::pickArrayKeys</function></member>
70
95
<member>&seealso.array.sorting;</member>
71
96
</simplelist>
72
97
</para>
73
98
</refsect1>
74
99
</refentry>
75
-

76
100
<!-- Keep this comment at the end of the file
77
101
Local variables:
78
102
mode: sgml
79
103