Language Case Discrepancies?
| From: | John Donagher | Date: | Fri, 05 Jan 2001 22:37:07 +0000 |
| Subject: | Language Case Discrepancies? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-43092@lists.php.net to get a copy of this message | ||
Hey all-
I always liked the fact that classes and functions could be referenced with
any character case combination. But this has finally come back to bite me.
In my opinion, declaring a class like such:
class AbC {}
when instanciated, running a get_class() on the instanciated object should
not return 'abc', but the as-declared 'AbC' (why this is important is a long
story). After looking through the Zend code, I understand completely why
get_class() works the way it does, which is through no fault of its own, but
because of language internals.
Whether or not to make variables, constants, functions, and other language-level
data structures case-sensitive (or even consistent) is obviously not something
that should be mandated by the needs of a few. At the same time, having a
discrepancy between variable/constant and function/class case handling seems
wrong. And with a little extra design, get_class() (along with
get_parent_class(), etc..) could be made to return the case-correct version
regardless of the case sensitivity of the language itself.
Any thoughts?
--
John Donagher
Application Engineer
Intacct Corp. - Powerful Accounting on the Web
408-395-0989
720 University Ave.
Los Gatos CA 95032
www.intacct.com