Re: UltraSimple Namespace Solution

From: Date: Fri, 17 Oct 2008 11:02:42 +0000
Subject: Re: UltraSimple Namespace Solution
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-41213@lists.php.net to get a copy of this message
AFAIK the classes and the namespaces both are case insensitive. This means a major change (to make them to be kept in a sensitive way) and will break the code that depends on the insensibility. IMHO - bad idea. And besides the casing usially is used to enforce good coding practices, not language features. On Fri, Oct 17, 2008 at 1:53 PM, Nathan Rixham <nathan@kraya.co.uk> wrote: > *The Problem (as defined by Greg):* > > foo.php: > <?php > namespace one::step; > function two(){} > > namespace one; > class step { > static function two(){} > } > ?> > > main.php: > <?php > include 'foo.php'; > // is this class one::step or namespace one::step? > one::step::two(); > ?> > > > *A Simpler Solution* > Force userland / general naming conventions in PHP. > > # namespaces are always lowercase > # functions are always lowercase > # classes are always CamelCaps with initial uppercase letter enforced > > thus: > //this is always the function two in namespace one::step > one::step::two(); > //this is always the method two of class step in namespace one > one::Step::two(); > > thoughts, opinions, reasons why it wouldn't work? > > regards, > > nathan > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Vesselin Kenashkov developer at www.webstudiobulgaria.com

« previous php.internals (#41213) next »