Re: PHP and case-sensitivity inconsistency in PHP 6

From: Date: Sun, 26 Jan 2014 23:36:08 +0000
Subject: Re: PHP and case-sensitivity inconsistency in PHP 6
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi!

> 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.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227


Thread (15 messages)

« previous php.internals (#71615) next »