Re: Inconsistent float to string vs. string to floatcasting
| From: | Stanislav Malyshev | Date: | Tue, 01 Jan 2019 23:29:45 +0000 |
| Subject: | Re: Inconsistent float to string vs. string to floatcasting | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103658@lists.php.net to get a copy of this message | ||
Hi!
> So yes, (string)0.3 should return 0.3 in any locale.
If we designed it now, without any doubt. But since we have 20 years of
history behind... I'm not so sure.
> Finally, I don't think that the global locale is the real problem for
> PHP. Rather it's PHP locale handling and the fact that setlocale()
> works per process (and not per thread). When PHP starts up, no locale
That's part of locale being global. Though even in environment where
threads are not involved, many apps do not account for locale quirks.
--
Stas Malyshev
smalyshev@gmail.com