Re: RE: Patch: Fixing some .phpt's that fail with Wincache

From: Date: Tue, 26 Nov 2013 09:19:07 +0000
Subject: Re: RE: Patch: Fixing some .phpt's that fail with Wincache
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-70394@lists.php.net to get a copy of this message
2013.11.26. 7:31, "Nikita Popov" <nikita.ppv@gmail.com> ezt írta: > > On Mon, Nov 25, 2013 at 8:30 PM, Eric Stenson <ericsten@microsoft.com >wrote: > > > diff --git a/ext/standard/tests/strings/implode1.phpt > > b/ext/standard/tests/strings/implode1.phpt > > index > > 3997c54b59eb3b86777b64b58f7ce67f25acac55..3720c069276784a1b588da672f9731c89b4e5fb7 > > 100644 > > GIT binary patch > > delta 32 > > > > ncmeyY&D<tbfFK6f3Ks)Z+ZoqU2PC%oGJ>)s)RAM6{Uz()tUF > > > > delta 30 > > > > lcmeyW&oCxbe2SE32T?;{4L0<Wz;s6a{6o&8I}PnE<>^3giF) > > > > What's being changed here? > > diff --git a/tests/strings/001.phpt b/tests/strings/001.phpt > > index 3bfd3db..7b61835 100644 > > --- a/tests/strings/001.phpt > > +++ b/tests/strings/001.phpt > > @@ -180,6 +180,8 @@ if ($ss == "\$'") { > > echo "Testing uniqid: "; > > $str = "prefix"; > > $ui1 = uniqid($str); > > +/* Must sleep here to let uniqid generate a different unique ID */ > > +usleep( 10 ); > > $ui2 = uniqid($str); > > > > $len = strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29; > > > > Not sure this is right. uniqid() should generate different IDs even when > there are two subsequent calls. If it doesn't, that sounds like a bug. > > Nikita Only if the time is different, and AFAIR some platforms(like win) has less microtime precision, which could cause problems like that. But there is a more entropy param for uniqid, maybe that would be a better solution than sleep.

« previous php.internals (#70394) next »