Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85696 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10901 invoked from network); 2 Apr 2015 19:51:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2015 19:51:13 -0000 Authentication-Results: pb1.pair.com header.from=adam@adamharvey.name; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=adam@adamharvey.name; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain adamharvey.name designates 209.85.223.177 as permitted sender) X-PHP-List-Original-Sender: adam@adamharvey.name X-Host-Fingerprint: 209.85.223.177 mail-ie0-f177.google.com Received: from [209.85.223.177] ([209.85.223.177:36108] helo=mail-ie0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/88-56257-1BD9D155 for ; Thu, 02 Apr 2015 14:51:13 -0500 Received: by iedm5 with SMTP id m5so77590410ied.3 for ; Thu, 02 Apr 2015 12:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamharvey.name; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=SKMPAme0Q0eMW/S3olPLJcMyit/crwUIba14JuCpXec=; b=TKzhG/FF4sdQh/dJJz/u09Dmv6rClvL0IQXXG+24fcy+aSA8N45hb28OUFTrQSit2t wtGrqR+q2MJQNMbAXqxaQJfeNvuNYCPXw6Y6EaSVrBqlEJpEX/eT4mDHcyb7Ocgff9vm ugAALoyKgMKRBdB0EQlL4NxoUgW8xn3ZkNbu4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=SKMPAme0Q0eMW/S3olPLJcMyit/crwUIba14JuCpXec=; b=JiGTBDc/e8fY5KnRxo7N2iBHWT8LTm37lZ0I6GR2xWQWigUU3Fsg1v/uZRY/8j5VCb 456jG0qzaTGSYCYh/N3Rnt+6XArhxfoBFst7PJ6CAq8bYi80L/7Wsd2KjDQwjA/D7C22 bmXPnjx5+wFVLravLSEltusfDddvB2CLFgq7Xt/sRN8KWa0GCqt45o/+c/PCQzXdAAfs PkjaMAQ36CygaGmg+x0PYtTgy4oINAhjzM8bCBXX+BRSDJBHZvw+Sh4Tisdo8CWYwtFj Lgx65fL/KBWNQviH19tCZsq0S2+bbpXAX1a1knhHki5K/kOkzVaCxQWR04xgFe8/c/u0 XmJw== X-Gm-Message-State: ALoCoQliAN5wtDou6lu1NC/NrjpzPGaKYzEl6wHK0pJhvj/j6+U2AOHYbU9ZxEXmgqQ6tnYFjWd5 X-Received: by 10.50.32.7 with SMTP id e7mr22593716igi.21.1428004270300; Thu, 02 Apr 2015 12:51:10 -0700 (PDT) MIME-Version: 1.0 Sender: adam@adamharvey.name Received: by 10.42.35.139 with HTTP; Thu, 2 Apr 2015 12:50:49 -0700 (PDT) In-Reply-To: References: <551CEDF6.7090408@lerdorf.com> Date: Thu, 2 Apr 2015 12:50:49 -0700 X-Google-Sender-Auth: 8x4UzztLJWoYAlk4z90F39WRDM8 Message-ID: To: Dan Ackroyd Cc: Keyur Govande , Rasmus Lerdorf , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Deprecate setlocale? From: aharvey@php.net (Adam Harvey) On 2 April 2015 at 12:24, Dan Ackroyd wrote: > On 2 April 2015 at 16:01, Keyur Govande wrote: >> >> >> To Rasmus's point, here's a PR for HHVM to provide a thread-safe setlocale >> implementation: https://github.com/facebook/hhvm/pull/4736/files >> >> It should be fairly easy to refactor the thread-safe-setlocale.(h/cpp) files >> for Zend. > > Ok, that' pretty awesome. So assumming that we incorporated that new > thread safe version of locale, how would we expose it? Most people who > are calling setlocale are unaware of it's side effects, and so should > be using the new safe version by default. > > Some people who are calling setlocale will actually be using the > cross-thread behaviour and so that still needs to work. > > setlocale is a variadic function, so it's not possible to hack in a > flag parameter. As much as I dislike ini settings, it seems like > adding one here would be sensible e.g. 'thread_safe_setlocale' > > * If it's enabled the setlocale function calls the new thread safe > functionality. > > * If it's disabled the setlocale function calls the current non-TS C > setlocale function. > > > Does anyone have a better suggestion on exposing a thread safe version? What about just adding another function: setlocale_global(), or similar? I don't want a new INI setting any more than you do. Adam