note 57444 added to function.microtime
| From: | php dot net at sharpdreams dot com | Date: | Tue, 04 Oct 2005 14:51:26 +0000 |
| Subject: | note 57444 added to function.microtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96351@lists.php.net to get a copy of this message | ||
Contrary to what "cristianDOTzuddas-NOSPAM-com" states below, do NOT use his function to
create unique IDs. Use a real unique function such as uniqid(). See the examples on that http://php.net/uniqid and the user comments for ensuring that you
indeed do have a unique ID.
(Why is his example bad? It will produce the same unique identifier if the code runs twice at the
same time. Technically the statements could only execute simultaneously on a system with 2 or more
processors but compounding rounding and floating point errors will make a collision more likely.)
----
Manual Page -- http://www.php.net/manual/en/function.microtime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57444
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57444&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57444&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57444&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57444&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57444&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57444&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57444&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57444&report=yes
Search -- http://master.php.net/manage/user-notes.php