<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.random.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'function.mt-srand.php',
    1 => 'mt_srand',
    2 => 'Seeds the Mersenne Twister Random Number Generator',
  ),
  'up' => 
  array (
    0 => 'ref.random.php',
    1 => 'Random İşlevleri',
  ),
  'prev' => 
  array (
    0 => 'function.mt-rand.php',
    1 => 'mt_rand',
  ),
  'next' => 
  array (
    0 => 'function.rand.php',
    1 => 'rand',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/random/functions/mt-srand.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mt-srand" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mt_srand</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mt_srand</span> &mdash; <span class="dc-title">Seeds the Mersenne Twister Random Number Generator</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.mt-srand-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mt_srand</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$seed</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$mode</code><span class="initializer"> = <strong><code><a href="random.constants.php#constant.mt-rand-mt19937">MT_RAND_MT19937</a></code></strong></span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Seeds the random number generator with
   <code class="parameter">seed</code> or with a random value
   if no <code class="parameter">seed</code> is given.
  </p>

  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
<span class="simpara">Otomatik olarak yapıldığından <span class="function"><a href="function.srand.php" class="function">srand()</a></span> veya
<span class="function"><strong>mt_srand()</strong></span> işleviyle rasgele sayı üretecini tohumlamaya
ihtiyaç yoktur.</span></p></blockquote>
  <div class="caution"><strong class="caution">Dikkat</strong>
 <p class="para">
  Because the Mt19937 (“Mersenne Twister”) engine accepts only a single 32 bit integer as the
  seed, the number of possible random sequences is limited to just 2<sup class="superscript">32</sup>
  (i.e. 4,294,967,296), despite Mt19937’s huge period of 2<sup class="superscript">19937</sup>-1.
 </p>
 <p class="para">
  When relying on either implicit or explicit random seeding, duplications will appear
  much earlier. Duplicated seeds are expected with 50% probability after less than
  80,000 randomly generated seeds according to the birthday problem. A 10% probability
  of a duplicated seed happens after randomly generating roughly 30,000 seeds.
 </p>
 <p class="para">
  This makes Mt19937 unsuitable for applications where duplicated sequences must not happen with
  more than a negligible probability. If reproducible seeding is required, both the
  <span class="classname"><a href="class.random-engine-xoshiro256starstar.php" class="classname">Random\Engine\Xoshiro256StarStar</a></span> and <span class="classname"><a href="class.random-engine-pcgoneseq128xslrr64.php" class="classname">Random\Engine\PcgOneseq128XslRr64</a></span>
  engines support much larger seeds that are unlikely to collide randomly. If reproducibility
  is not required, the <span class="classname"><a href="class.random-engine-secure.php" class="classname">Random\Engine\Secure</a></span> engine provides cryptographically
  secure randomness.
 </p>
</div>

 </div>

 <div class="refsect1 parameters" id="refsect1-function.mt-srand-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">seed</code></dt>
     <dd>
      <p class="para">
       Fills the state with values generated with a linear congruential generator
       that was seeded with <code class="parameter">seed</code> interpreted as an unsigned
       32 bit integer.
      </p>
      <p class="para">
       If <code class="parameter">seed</code> is omitted or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, a random unsigned
       32-bit integer will be used.
      </p>
     </dd>
    
    
     <dt><code class="parameter">mode</code></dt>
     <dd>
      <p class="para">
       Use one of the following constants to specify the implementation of the algorithm to use.
       <ul class="simplelist">
        <li>
         <strong><code><a href="random.constants.php#constant.mt-rand-mt19937">MT_RAND_MT19937</a></code></strong>:
         The correct Mt19937 implementation, available as of PHP 7.1.0.
        </li>
        <li>
         <strong><code><a href="random.constants.php#constant.mt-rand-php">MT_RAND_PHP</a></code></strong>
         Uses an incorrect Mersenne Twister implementation which was used as the default up till PHP 7.1.0.
         This mode is available for backward compatibility.
        </li>
       </ul>
      </p>
      <div class="warning"><strong class="warning">Uyarı</strong><p class="simpara">Bu özelliğin kullanımı PHP 8.3.0
itibariyle <em>ÖNERİLMEMEKTEDİR</em>.
Bu özelliğe kesinlikle güvenilmemelidir.</p></div>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mt-srand-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">
   Hiçbir değer dönmez.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mt-srand-changelog">
  <h3 class="title">Sürüm Bilgisi</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Sürüm: </th>
       <th>Açıklama</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.3.0</td>
       <td>
        <code class="parameter">seed</code> is now nullable.
       </td>
      </tr>

      <tr>
       <td>7.1.0</td>
       <td>
        <span class="function"><a href="function.srand.php" class="function">srand()</a></span> <a href="migration71.incompatible.php#migration71.incompatible.rand-srand-aliases" class="link">has been made</a> an alias of <span class="function"><strong>mt_srand()</strong></span>.
       </td>
      </tr>

      <tr>
       <td>7.1.0</td>
       <td>
        <span class="function"><a href="function.mt-rand.php" class="function">mt_rand()</a></span> <a href="migration71.incompatible.php#migration71.incompatible.fixes-to-mt_rand-algorithm" class="link">has been updated</a> to use the fixed, correct, version of
         the Mersenne Twister algorithm. To fall back to the old behaviour, use <span class="function"><strong>mt_srand()</strong></span> with <strong><code><a href="random.constants.php#constant.mt-rand-php">MT_RAND_PHP</a></code></strong> as the second parameter.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.mt-srand-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mt-rand.php" class="function" rel="rdfs-seeAlso">mt_rand()</a> - Generate a random value via the Mersenne Twister Random Number Generator</span></li>
    <li><span class="function"><a href="function.mt-getrandmax.php" class="function" rel="rdfs-seeAlso">mt_getrandmax()</a> - Show largest possible random value</span></li>
    <li><span class="function"><a href="function.srand.php" class="function" rel="rdfs-seeAlso">srand()</a> - Seed the random number generator</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>