Re: Re: [PATCH] Constant expr folding (again), and other things
| From: | Dmitry Stogov | Date: | Sun, 31 Aug 2008 08:39:22 +0000 |
| Subject: | Re: Re: [PATCH] Constant expr folding (again), and other things | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-40182@lists.php.net to get a copy of this message | ||
Hi Stas,
We discussed this patch with Matt, and I allowed this change.
So it probably my fault (I missed run-time locale change possibility).
I don't think it is a really big issue, but it really may change behavior of some scripts.
I think we should revert this patch, before we get complete solution for compile-time expression evaluation (not in 5.3 of course).
Thanks. Dmitry.
Stanislav Malyshev wrote:
Hi!We could get into trouble here. Imagine: static $a = -'12.8'; This should be -12.8, but what if locale changes and . is no longer decimal separator? Moreover, what if locale changes between compile and runtime? We get entirely different code now.static $a = -'abc'; // 0 static $b = +'abc'; // abc $c = +'abc'; // 0}Well, I don't know if it can be tossed in quickly at this time, but there ya go since I think it's pretty basic! ;^)I think it's not the feature that can be "tossed in quickly" - it can have some obscure side effects, as I described in my later emails.