Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70412 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66182 invoked from network); 26 Nov 2013 17:35:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2013 17:35:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=ericsten@microsoft.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ericsten@microsoft.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain microsoft.com designates 207.46.163.237 as permitted sender) X-PHP-List-Original-Sender: ericsten@microsoft.com X-Host-Fingerprint: 207.46.163.237 mail-by2lp0237.outbound.protection.outlook.com Received: from [207.46.163.237] ([207.46.163.237:46253] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/55-39355-0FBD4925 for ; Tue, 26 Nov 2013 12:35:46 -0500 Received: from BLUPR03MB421.namprd03.prod.outlook.com (10.141.78.140) by BLUPR03MB422.namprd03.prod.outlook.com (10.141.78.143) with Microsoft SMTP Server (TLS) id 15.0.820.5; Tue, 26 Nov 2013 17:35:41 +0000 Received: from BLUPR03MB421.namprd03.prod.outlook.com ([10.141.78.140]) by BLUPR03MB421.namprd03.prod.outlook.com ([10.141.78.140]) with mapi id 15.00.0820.005; Tue, 26 Nov 2013 17:35:41 +0000 To: Tjerk Meesters , Ferenc Kovacs CC: Nikita Popov , "internals@lists.php.net" , Pierre Joye Thread-Topic: [PHP-DEV] RE: Patch: Fixing some .phpt's that fail with Wincache Thread-Index: Ac7qEf1rAkElSMukSJS7efsl8cTrvAAAreGgABcTn4AABeLOgAAAzjyAABAc6OA= Date: Tue, 26 Nov 2013 17:35:41 +0000 Message-ID: <9095b88708ea45cbbaffdcf645b96450@BLUPR03MB421.namprd03.prod.outlook.com> References: <3723aa16373647e5ad01f33992ac4c9c@BLUPR03MB421.namprd03.prod.outlook.com> <6e85635635da4ac193a5ba309d4dbd96@BLUPR03MB421.namprd03.prod.outlook.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:4898:80e8:ee31::3] x-forefront-prvs: 00429279BA x-forefront-antispam-report: SFV:NSPM;SFS:(199002)(189002)(377454003)(51704005)(24454002)(59766001)(69226001)(56816003)(19580395003)(53806001)(49866001)(54356001)(74662001)(76482001)(74502001)(76796001)(74366001)(19300405004)(81342001)(51856001)(83072001)(74316001)(2656002)(15202345003)(47736001)(56776001)(87936001)(63696002)(87266001)(47976001)(77982001)(54316002)(83322001)(50986001)(4396001)(79102001)(19580405001)(85306002)(80022001)(33646001)(81816001)(76576001)(81686001)(80976001)(16236675002)(46102001)(74706001)(15975445006)(76786001)(81542001)(31966008)(65816001)(47446002)(74876001)(142923001)(3826001)(24736002);DIR:OUT;SFP:;SCL:1;SRVR:BLUPR03MB422;H:BLUPR03MB421.namprd03.prod.outlook.com;CLIP:2001:4898:80e8:ee31::3;FPR:;RD:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: multipart/alternative; boundary="_000_9095b88708ea45cbbaffdcf645b96450BLUPR03MB421namprd03pro_" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com Subject: RE: [PHP-DEV] RE: Patch: Fixing some .phpt's that fail with Wincache From: ericsten@microsoft.com (Eric Stenson) --_000_9095b88708ea45cbbaffdcf645b96450BLUPR03MB421namprd03pro_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable From: Tjerk Meesters [mailto:tjerk.meesters@gmail.com] Sent: Tuesday, November 26, 2013 1:42 AM > 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: [...] > > > $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; > > > > > 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 re= sult with php_combined_lcg(). > > I'm sure there was a good reason to do so, but it does seem counter-intui= tive at best. > Ah! My bad. Please remove the usleep(10) and add the ', true' (more entro= py) param to the uniqid() call. This test consistently fails on Windows. For completeness of coverage, you might consider also testing with the usle= ep(1) and without the ', true' (more entropy) param. Thx! --E. --_000_9095b88708ea45cbbaffdcf645b96450BLUPR03MB421namprd03pro_--