php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #8111 wrong example
Submitted: 2000-12-05 03:39 UTC Modified: 2000-12-21 14:50 UTC
From: pra at mgn dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.3pl1 OS: solaris
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pra at mgn dot net
New email:
PHP Version: OS:

 

 [2000-12-05 03:39 UTC] pra at mgn dot net
this example (of the documentation of mt_srand()) 
<?
      // seed with microseconds since last "whole" second
      mt_srand ((double) microtime() * 1000000);
      echo mt_rand();
?>
always give the same value.

this example work well
<?
      // seed with microseconds since last "whole" second
      mt_srand (substr(microtime(),2));
      echo mt_rand();
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-21 14:50 UTC] hholzgra@php.net
can't reproduce this with 4.0.3 on solaris or linux ...
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Jun 15 18:00:01 2026 UTC