Re: Deprecate setlocale?

From: Date: Thu, 02 Apr 2015 19:24:42 +0000
Subject: Re: Deprecate setlocale?
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-85695@lists.php.net to get a copy of this message
On 2 April 2015 at 16:01, Keyur Govande <keyurgovande@gmail.com> 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? cheers Dan

« previous php.internals (#85695) next »