RE: [PHP-DEV] my last attempt at sanity with namespaces

From: Date: Thu, 16 Oct 2008 07:44:49 +0000
Subject: RE: [PHP-DEV] my last attempt at sanity with namespaces
Groups: php.internals 
Request: Send a blank email to internals+get-41113@lists.php.net to get a copy of this message
Hi, > http://wiki.php.net/rfc/namespaceissues > > Read it and discuss. Solution #1 is imho the best one to disambiguate everything, but the readability problem is not to be overlooked. To keep this short, just read the following rewrite of the lines for the problem code: foo.php <?php namespace one..step; function two(){} namespace one; class step { static function two(){} } ?> main.php <?php include 'foo.php'; one..step::two(); // clearly namespace one, static method on class step one..step..two(); // clearly namespace one..step, function two ?> Addressing the cons for the ::: separator: 1. all existing namespace code must still be rewritten, sorry about that. 2. this..example..with::slight..error..is..much..easier..to::see(); Two sequential dots currently produce a syntax error, so the implementation doesn't have to worry about ambiguity or bc-issues. Disclaimer: I have not written any namespaced php code yet (so I'm not worried about con #1 ;-)). Ciao, Marc.

« previous php.internals (#41113) next »