TITLE ^

namespaces - Notes on namespaces in PHP

Namespaces in Pipp ^

A namespace is introduced with the keyword namespace. There can be multiple namespaces per file. They are not nested. Namespaces don't carry over to included files. define() doesn't define in the current namespace. The backslash character serves as the namespace separator. Short names can be defined with use. Only classes, functions and constants are namespaced. The current namespace can be queried with __NAMESPACE__. Namespaces are case insensitive. No global code can precede the first namespace directive. Free code is disallowed within namespaces.

Implementation in Pipp ^

Currently the namespace directive is only parsed.

In order to ease implementation and testing, there will be some divergences in Pipp. Code before the first namespace directive is allowed. Free code within namespace is allowed. There will be namespaced variables as well. 'namespace \;' indicates the return to the root namespace.

AUTHOR ^

Bernhard Schmalhofer - <Bernhard.Schmalhofer@gmx.de>

SEE ALSO ^

  L<http://docs.php.net/manual/en/language.namespaces.php>
  L<http://wiki.php.net/rfc/namespaces>
  L<http://wiki.php.net/rfc/namespaceseparator>
  L<http://wiki.php.net/rfc/backslashnamespaces>
  L<http://wiki.php.net/rfc/namespacecurlies>
  L<http://wiki.php.net/rfc/namespaceref>
  L<http://inside.webfactory.de/en/blog/php-namespaces-explained.html>
  L<http://marc.info/?l=php-internals&m=121527668606247>
  L<http://bugs.php.net/bug.php?id=46304>
  L<http://loveandtheft.org/2008/10/26/set-sail-for-fail-php-namespaces/>


parrot