# my last attempt at sanity with namespaces

- Thread: https://externals.io/message/41113
- Original archive: https://news-web.php.net/php.internals/41113
- Started by Marc Boeren on 2008-10-16T07:44:49+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #41113 — Marc Boeren — 2008-10-16T07:44:49+00:00

URL: https://externals.io/message/41113#41113

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.
