philip Fri May 30 15:48:38 2003 EDT Modified files: /phpdoc/en/reference/math/functions srand.xml rand.xml mt-srand.xml mt-rand.xml /phpdoc/en/reference/array/functions shuffle.xml array-rand.xml Log: Implement ¬e.randomseed; which states that random number generation is automatic as of PHP 4.2.0 Index: phpdoc/en/reference/math/functions/srand.xml diff -u phpdoc/en/reference/math/functions/srand.xml:1.4 phpdoc/en/reference/math/functions/srand.xml:1.5 --- phpdoc/en/reference/math/functions/srand.xml:1.4 Mon Jun 3 11:06:16 2002 +++ phpdoc/en/reference/math/functions/srand.xml Fri May 30 15:48:38 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/math.xml, last change in rev 1.2 --> <refentry id="function.srand"> <refnamediv> @@ -18,6 +18,7 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php // seed with microseconds function make_seed() { list($usec, $sec) = explode(' ', microtime()); @@ -25,16 +26,14 @@ } srand(make_seed()); $randval = rand(); +?> ]]> </programlisting> </informalexample> </para> - <note> - <para> - Since PHP 4.2.0 it's no longer necessary to seed the random number - generator before using it. - </para> - </note> + + ¬e.randomseed; + <simpara> See also <function>rand</function>, <function>getrandmax</function> and Index: phpdoc/en/reference/math/functions/rand.xml diff -u phpdoc/en/reference/math/functions/rand.xml:1.4 phpdoc/en/reference/math/functions/rand.xml:1.5 --- phpdoc/en/reference/math/functions/rand.xml:1.4 Mon Jun 3 11:06:16 2002 +++ phpdoc/en/reference/math/functions/rand.xml Fri May 30 15:48:38 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/math.xml, last change in rev 1.2 --> <refentry id="function.rand"> <refnamediv> @@ -21,11 +21,9 @@ between 5 and 15 (inclusive), for example, use <literal>rand (5, 15)</literal>. </simpara> - <simpara> - In older versions of PHP, you had to seed the random number generator - before use with <function>srand</function>. Since 4.2.0 this is no - longer necessary. - </simpara> + + ¬e.randomseed; + <note> <para> In versions before 3.0.7 the meaning of Index: phpdoc/en/reference/math/functions/mt-srand.xml diff -u phpdoc/en/reference/math/functions/mt-srand.xml:1.4 phpdoc/en/reference/math/functions/mt-srand.xml:1.5 --- phpdoc/en/reference/math/functions/mt-srand.xml:1.4 Mon Jun 3 11:06:16 2002 +++ phpdoc/en/reference/math/functions/mt-srand.xml Fri May 30 15:48:38 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/math.xml, last change in rev 1.2 --> <refentry id="function.mt-srand"> <refnamediv> @@ -18,6 +18,7 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php // seed with microseconds function make_seed() { list($usec, $sec) = explode(' ', microtime()); @@ -25,16 +26,14 @@ } mt_srand(make_seed()); $randval = mt_rand(); +?> ]]> </programlisting> </informalexample> </para> - <note> - <para> - Since PHP 4.2.0 it's no longer necessary to seed the random number - generator before using it. - </para> - </note> + + ¬e.randomseed; + <simpara> See also <function>mt_rand</function>, <function>mt_getrandmax</function> and <function>srand</function>. Index: phpdoc/en/reference/math/functions/mt-rand.xml diff -u phpdoc/en/reference/math/functions/mt-rand.xml:1.5 phpdoc/en/reference/math/functions/mt-rand.xml:1.6 --- phpdoc/en/reference/math/functions/mt-rand.xml:1.5 Fri Nov 15 14:47:05 2002 +++ phpdoc/en/reference/math/functions/mt-rand.xml Fri May 30 15:48:38 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./en/functions/math.xml, last change in rev 1.2 --> <refentry id="function.mt-rand"> <refnamediv> @@ -33,11 +33,9 @@ between 5 and 15 (inclusive), for example, use <literal>mt_rand (5, 15)</literal>. </simpara> - <simpara> - In older versions of PHP, you had to seed the random number generator - before use with <function>mt_srand</function>. Since 4.2.0 this is no - longer necessary. - </simpara> + + ¬e.randomseed; + <note> <para> In versions before 3.0.7 the meaning of Index: phpdoc/en/reference/array/functions/shuffle.xml diff -u phpdoc/en/reference/array/functions/shuffle.xml:1.5 phpdoc/en/reference/array/functions/shuffle.xml:1.6 --- phpdoc/en/reference/array/functions/shuffle.xml:1.5 Fri May 30 14:12:53 2003 +++ phpdoc/en/reference/array/functions/shuffle.xml Fri May 30 15:48:38 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.shuffle"> <refnamediv> @@ -32,6 +32,9 @@ </programlisting> </example> </para> + + ¬e.randomseed; + <para> See also <function>arsort</function>, <function>asort</function>, <function>ksort</function>, <function>rsort</function>, Index: phpdoc/en/reference/array/functions/array-rand.xml diff -u phpdoc/en/reference/array/functions/array-rand.xml:1.5 phpdoc/en/reference/array/functions/array-rand.xml:1.6 --- phpdoc/en/reference/array/functions/array-rand.xml:1.5 Fri May 30 13:44:31 2003 +++ phpdoc/en/reference/array/functions/array-rand.xml Fri May 30 15:48:38 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.13 --> <refentry id="function.array-rand"> <refnamediv> @@ -28,12 +28,9 @@ of keys for the random entries. This is done so that you can pick random keys as well as values out of the array. </para> - <note> - <para> - As of PHP 4.2.0, there is no need to seed the random number generator - with <function>srand</function>, as this is now done automatically. - </para> - </note> + + ¬e.randomseed; + <para> <example> <title><function>array_rand</function> example</title>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php