Re: BreakIterator

From: Date: Fri, 01 Jun 2012 07:57:08 +0000
Subject: Re: BreakIterator
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-60705@lists.php.net to get a copy of this message
On Fri, 01 Jun 2012 09:40:19 +1000, David Muir wrote:
Coming from a "pleb", my only concern is the name if the class is in the global scope. A "BreakIterator" to me sounds like something related to breaking out of a looping structure, and not something used for iterating over various language structure boundaries. If it's in a ICU namespace, then it's not a problem, as it's clearly related to Unicode.
We currently don't use namespaces in any of the core extensions. All the other symbols in ext/intl are in the global namespace; to put BreakIterator in a new namespace would be inconsistent -- and to put the whole extension would be a huge BC break. As to the name chosen to the class, it just mirrors the name used in ICU. In some cases, we prefixed the class name with Intl, in order to minimize the likelihood of symbols collisions or distinguish it from other similar functionality in PHP (something namespaces would be more appropriate for), but otherwise we prefer to keep the symbols names used in ICU in order to make it easy for people who already know the native API. Additionally, I think your concerns are exaggerated. The symbol BreakIterator can only used in contexts where it's obvious it's a class name, as in BreakIterator::createWordInstance('en'). -- Gustavo Lopes

« previous php.internals (#60705) next »