Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70396 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18131 invoked from network); 26 Nov 2013 09:42:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2013 09:42:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.176 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.220.176 mail-vc0-f176.google.com Received: from [209.85.220.176] ([209.85.220.176:56749] helo=mail-vc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/A1-08401-5FC64925 for ; Tue, 26 Nov 2013 04:42:13 -0500 Received: by mail-vc0-f176.google.com with SMTP id lf12so3573449vcb.21 for ; Tue, 26 Nov 2013 01:42:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lm1sOmVKEfZZyhIvtiJ+BnvYKsR4J6laJRCI85DO4xI=; b=zeiffJGDGRaYWr+i1pfgk7HjN0tgNSdC+1uxRonMp4C1EyfG3RaTVJ29J2CRg1dhwj v5XQNVSNSv6KqKT4LcVo5HqMDN1mLTlTfn71a1YGzqIKXdd+j97tsg8lHbXsDv8nWs3B DBxpPz0OZd7+8ShE4mZNeCO07caCZtNhVQT0Rotj87O4mUke6r0DErvXptVraaCWajDU qDp2vUOFlQaYqsP4uh2ajwIRAOuLmjGALRTeKqban0+YmsEI3CHjXFHg1Eq48F/yP8c5 BJZ5TQeqU+WxXSRsC999VHbZpMLFqNBpPeztP1LTglhvmb6MnhtaH1PHTwLklD5mn3dP JHzQ== MIME-Version: 1.0 X-Received: by 10.220.16.73 with SMTP id n9mr4768028vca.24.1385458931063; Tue, 26 Nov 2013 01:42:11 -0800 (PST) Received: by 10.58.128.33 with HTTP; Tue, 26 Nov 2013 01:42:11 -0800 (PST) In-Reply-To: References: <3723aa16373647e5ad01f33992ac4c9c@BLUPR03MB421.namprd03.prod.outlook.com> <6e85635635da4ac193a5ba309d4dbd96@BLUPR03MB421.namprd03.prod.outlook.com> Date: Tue, 26 Nov 2013 17:42:11 +0800 Message-ID: To: Ferenc Kovacs Cc: Nikita Popov , "internals@lists.php.net" , Eric Stenson , Pierre Joye Content-Type: multipart/alternative; boundary=001a11c3bea06fe23b04ec114b36 Subject: Re: [PHP-DEV] RE: Patch: Fixing some .phpt's that fail with Wincache From: tjerk.meesters@gmail.com (Tjerk Meesters) --001a11c3bea06fe23b04ec114b36 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Nov 26, 2013 at 5:19 PM, Ferenc Kovacs wrote: > 2013.11.26. 7:31, "Nikita Popov" ezt =EDrta: > > > > On Mon, Nov 25, 2013 at 8:30 PM, Eric Stenson >wrote: > > > > > diff --git a/ext/standard/tests/strings/implode1.phpt > > > b/ext/standard/tests/strings/implode1.phpt > > > index > > > > > 3997c54b59eb3b86777b64b58f7ce67f25acac55..3720c069276784a1b588da672f9731c= 89b4e5fb7 > > > 100644 > > > GIT binary patch > > > delta 32 > > > ncmeyY`&D)s)RAM6{Uz()tUF > > > > > > delta 30 > > > lcmeyW`&oCxb`e2SE32T?;{4L0^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 =3D=3D "\$'") { > > > echo "Testing uniqid: "; > > > $str =3D "prefix"; > > > $ui1 =3D uniqid($str); > > > +/* Must sleep here to let uniqid generate a different unique ID */ > > > +usleep( 10 ); > > > $ui2 =3D uniqid($str); > > > > > > $len =3D strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29; > > > > > > > Not sure this is right. uniqid() should generate different IDs even whe= n > > 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 les= s > microtime precision, which could cause problems like that. > But there is a more entropy param for uniqid, maybe that would be a bette= r > solution than sleep. > Internally, uniqid() uses usleep(1) only if 'more entropy' is omitted and not on Windows and Cygwin (must use 'more entropy'). So, when 'more entropy' is present, it will skip usleep(1) but pad the result with php_combined_lcg(). I'm sure there was a good reason to do so, but it does seem counter-intuitive at best. --=20 -- Tjerk --001a11c3bea06fe23b04ec114b36--