Hi,
This post is about bug #18556 (https://bugs.php.net/bug.php?id=18556)
which is a decade old.
As the recent comments on that page indicate, there's not a
deterministic way to resolve this issue, apart from eliminating
tolower() calls for function/class names during lookup. Hence totally
case-sensitive PHP.
Before opposing with "No, this will break a lot of existing code!", note
that I'm not suggesting a static permanent change in the engine; rather
a runtime option that will need to be enabled (cli option, INI setting),
without which PHP will work as before.
Since I'm not well versed in the workings of Zend engine, I solicit the
wisdom/experience of people in this list: Is this doable in a practical
way, without making grand changes in Zend?
best regards,
This post is about bug #18556 (https://bugs.php.net/bug.php?id=18556)
which is a decade old.As the recent comments on that page indicate, there's not a
deterministic way to resolve this issue, apart from eliminating
tolower() calls for function/class names during lookup. Hence totally
case-sensitive PHP.Before opposing with "No, this will break a lot of existing code!",
note that I'm not suggesting a static permanent change in the engine;
rather a runtime option that will need to be enabled (cli option, INI
setting), without which PHP will work as before.Since I'm not well versed in the workings of Zend engine, I solicit
the wisdom/experience of people in this list: Is this doable in a
practical way, without making grand changes in Zend?
It's not just about changes to the engine. If you introduce a runtime
option that switches behavior, you then get a portability problem --
code runs fine in one context, but not the other.
--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Yup - a one time transition would be preferable to that.
On Fri, Apr 20, 2012 at 9:13 AM, Matthew Weier O'Phinney
weierophinney@php.net wrote:
This post is about bug #18556 (https://bugs.php.net/bug.php?id=18556)
which is a decade old.As the recent comments on that page indicate, there's not a
deterministic way to resolve this issue, apart from eliminating
tolower() calls for function/class names during lookup. Hence totally
case-sensitive PHP.Before opposing with "No, this will break a lot of existing code!",
note that I'm not suggesting a static permanent change in the engine;
rather a runtime option that will need to be enabled (cli option, INI
setting), without which PHP will work as before.Since I'm not well versed in the workings of Zend engine, I solicit
the wisdom/experience of people in this list: Is this doable in a
practical way, without making grand changes in Zend?It's not just about changes to the engine. If you introduce a runtime
option that switches behavior, you then get a portability problem --
code runs fine in one context, but not the other.--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc--
--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com
Yup - a one time transition would be preferable to that.
Then the question is: Why? What's the benefit from a break? Is there a
need to have imagecreatefrompng()
next to a ImageCreateFromPNG()
? Or is
the reason to be a tiny bit faster? Or is the reason to break
"everything" "just" for consistency?
johannes
In past years such switches where deprecated and removed (in 5.3 most of
them, in 5.4 finally all that stuff is gone for good). So any solution,
involving a switch that modifies how code is executed will hit a wall of
resistance. It's the lesson that was learned the hard way.
So it may be the case to make PHP case-sensetive. There will be code
broken, probably a lot. But that can be fixed, and I personally always
write with respect to char case, so that will be no problem for me.
20 апреля 2012 г. 13:20 пользователь C.Koy can5koy@gmail.com написал:
Hi,
This post is about bug #18556 (https://bugs.php.net/bug.php?**id=18556https://bugs.php.net/bug.php?id=18556)
which is a decade old.As the recent comments on that page indicate, there's not a deterministic
way to resolve this issue, apart from eliminating tolower() calls for
function/class names during lookup. Hence totally case-sensitive PHP.Before opposing with "No, this will break a lot of existing code!", note
that I'm not suggesting a static permanent change in the engine; rather a
runtime option that will need to be enabled (cli option, INI setting),
without which PHP will work as before.Since I'm not well versed in the workings of Zend engine, I solicit the
wisdom/experience of people in this list: Is this doable in a practical
way, without making grand changes in Zend?best regards,
Hi,
This post is about bug #18556 (https://bugs.php.net/bug.php?id=18556) which
is a decade old.As the recent comments on that page indicate, there's not a deterministic
way to resolve this issue, apart from eliminating tolower() calls for
function/class names during lookup. Hence totally case-sensitive PHP.Before opposing with "No, this will break a lot of existing code!", note
that I'm not suggesting a static permanent change in the engine; rather a
runtime option that will need to be enabled (cli option, INI setting),
without which PHP will work as before.Since I'm not well versed in the workings of Zend engine, I solicit the
wisdom/experience of people in this list: Is this doable in a practical way,
without making grand changes in Zend?
I'm not sure whether I really get the issue, but as it seems the
problem seems to be that PHP is using locale-aware lowercasing
functions in the core. Couldn't the issue be fixed by replacing those
with local-unaware functions? Why does one have to change PHPs general
case sensitivity handling for that?
Nikita
Because you can write a function name, say, in Cyrilic and it will just
work.
20 апреля 2012 г. 16:47 пользователь Nikita Popov <nikita.ppv@googlemail.com
написал:
Hi,
This post is about bug #18556 (https://bugs.php.net/bug.php?id=18556)
which
is a decade old.As the recent comments on that page indicate, there's not a deterministic
way to resolve this issue, apart from eliminating tolower() calls for
function/class names during lookup. Hence totally case-sensitive PHP.Before opposing with "No, this will break a lot of existing code!", note
that I'm not suggesting a static permanent change in the engine; rather a
runtime option that will need to be enabled (cli option, INI setting),
without which PHP will work as before.Since I'm not well versed in the workings of Zend engine, I solicit the
wisdom/experience of people in this list: Is this doable in a practical
way,
without making grand changes in Zend?
I'm not sure whether I really get the issue, but as it seems the
problem seems to be that PHP is using locale-aware lowercasing
functions in the core. Couldn't the issue be fixed by replacing those
with local-unaware functions? Why does one have to change PHPs general
case sensitivity handling for that?Nikita
As the recent comments on that page indicate, there's not a deterministic
way to resolve this issue, apart from eliminating tolower() calls for
function/class names during lookup. Hence totally case-sensitive PHP.
What about instead creating a special-purpose Zend function to normalize
class names (zend_normalize_class_name, or zend_classname_tolower)? This
function would examine the current locale and, if it's a problematic one,
convert the string to lower case on its own (calling zend_tolower on
non-problematic characters). Alternatively, zend_normalize_class_name could
switch LC_CTYPE
to an appropriate locale (e.g. "UTF-8"; the locale could be
determined at compile time), call zend_str_tolower_copy, then switch back
before returning. Then, any appropriate function (e.g.
zend_resolve_class_name, zend_lookup_class_ex, class_exists, class_alias)
would call zend_normalize_class_name instead of zend_str_tolower_copy/
zend_str_tolower_dup.
The two problems with this approach are
- additional time-cost. However, if done right, this should have little
impact. - break class names using words in the locale-language. For example, a
class named "IzgaraGörünümü" would be converted to "izgaragörünümü", rather
than "ızgaragörünümü". However, this impact should be less than that caused
by the current bug.
Does this bug pop-up for locales other than Turkish, Azerbaijani and Kurdish
?
Hi,
I'm just curious if anyone took benchmark.
PoC would be simple enough.
Some figures are needed for decision.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net