On June 18, 2002 10:07 am, Hartmut Holzgraefe wrote:
> Sure set_locale() *works* for threaded environments, but it sets the locale
> globaly for *all* threads, while it should the current PHP thread only.
> Even worse: setting the locale may affect other components within the
> webserver totally unrelated to PHP (or trigger the now known tolower()
> and strtod() problems in other PHP threads, leading to wrong parser
> behaviour)
>
> just imagine an ISP hosting a threaded server for international
> customers or a big multinational company (or even a small one
> with multi-lingual web pages) where a lot of scripts running in parallel
> use set_locale() -> each of them overwrites the current locale for all
> the other runnning scripts ... GOTCHA

Well, that is true for any external variable not just locale. For example if 
you export TZ variable in a threaded enviroment all threads would be 
affected. Exporting a TZ would be even more dangerous since it would affect a 
commonly used data, dates, which are used in majority of PHP script.
I do not see how this issue can be resolved, unless PHP does some internal 
enviroment variable tracking as well as internal locale tracking. 

Ilia

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to