Re: PHP and case-sensitivity inconsistency in PHP 6
| From: | Yasuo Ohgaki | Date: | Tue, 28 Jan 2014 00:45:53 +0000 |
| Subject: | Re: PHP and case-sensitivity inconsistency in PHP 6 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-71653@lists.php.net to get a copy of this message | ||
Hi all,
On Mon, Jan 27, 2014 at 8:36 AM, Stas Malyshev <smalyshev@sugarcrm.com>wrote:
> > So essentially, I would like to see case sensitivity at call time
> > (called name must match declaration), but case insensitivity at
> > declaration time (when checking whether a symbol has already been
> > declared):
>
> What would function_exists('Foo') return when foo() is defined?
>
> If false, then this code:
>
> if (!function_exists('Foo')) {
> function Foo() { ... }
> }
>
> would not work. If true, then this code:
>
> if(function_exists('Foo')) {
> Foo();
> }
>
> would not work. Both are working fine now and there's no real reason why
> shouldn't they keep working.
>
> Additionally, making the engine case-sensitive would simplify some areas
> of function/class handling. But making it inconsistently partially
> case-sensitive would instead complicate it, as we now would have to make
> additional checks against original name before calling.
>
> My opinion is if we go case-sensitive, it must be full case sensitivity,
> no exceptions.
+1 for full case sensitivity, no exceptions.
We may provide compatibility check and conversion scripts
using tokenizer module.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net