FAQ
Hi Pierre,

Why is uniqid() is not guarantee uniqueness under windows?

https://bugs.php.net/bug.php?id=65626

It seems PHP_WIN32 and __CYGWIN__ check is obsolete.
Could it be removed?

Regards,

--
Yasuo Ohgaki
yohgaki@ohgaki.net

Search Discussions

  • Anatol Belski at Feb 8, 2014 at 10:19 pm
    Hi Yasuo,
    On Sat, February 8, 2014 22:14, Yasuo Ohgaki wrote:
    Hi Pierre,


    Why is uniqid() is not guarantee uniqueness under windows?


    https://bugs.php.net/bug.php?id=65626
    its base are microseconds, so nothing prevents to usleep() in user space.
    It's also documented to be nonsecure, so isn't it just the expected
    behavior?
    It seems PHP_WIN32 and __CYGWIN__ check is obsolete.
    Could it be removed?
    Never compiled with cygwin. However what stands in the code might be true
    needed, as cygwin is proxying native APIs, so it is expected to be much
    slowlier. Maybe there are other reasons for that, though.

    Regards

    Anatol
  • Pierre Joye at Feb 8, 2014 at 10:20 pm

    On Sat, Feb 8, 2014 at 10:14 PM, Yasuo Ohgaki wrote:
    Hi Pierre,

    Why is uniqid() is not guarantee uniqueness under windows?

    https://bugs.php.net/bug.php?id=65626

    It seems PHP_WIN32 and __CYGWIN__ check is obsolete.
    Could it be removed?
    Not sure, we have to test to see if it is necessary.

    But for cygwin, we do not support it so I won't do any testing with it.

    Cheers,
    --
    Pierre

    @pierrejoye | http://www.libgd.org
  • Yasuo Ohgaki at Feb 9, 2014 at 11:34 pm
    Hi all,
    On Sun, Feb 9, 2014 at 7:20 AM, Pierre Joye wrote:
    On Sat, Feb 8, 2014 at 10:14 PM, Yasuo Ohgaki wrote:
    Hi Pierre,

    Why is uniqid() is not guarantee uniqueness under windows?

    https://bugs.php.net/bug.php?id=65626

    It seems PHP_WIN32 and __CYGWIN__ check is obsolete.
    Could it be removed?
    Not sure, we have to test to see if it is necessary.

    But for cygwin, we do not support it so I won't do any testing with it.

    https://github.com/yohgaki/php-src/commit/6c36a82ee84cfda0cb14c95b0c035849f73d8354

    Here is simple patch to test for windows. Could anyone try to see if it
    works?
    According to PHP_FUNCTION(microtime), it should work.

    Regards,

    --
    Yasuo Ohgaki
    yohgaki@ohgaki.net

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedFeb 8, '14 at 9:15p
activeFeb 9, '14 at 11:34p
posts4
users3
websitephp.net

People

Translate

site design / logo © 2021 Grokbase