xp-framework/rfc — Issue #222: Optional support for PHP 5.3 namespaces
Author: kiesel
Created: 2011-12-23 10:49:09+00:00
State: open
Labels: framework

Scope of Change
==
Support for writing and using classes within PHP 5.3 namespaces will be added to the XP Framework's core. Because PHP namespaces are only available with PHP >= 5.3.0, support will be optional - using XP with PHP 5.2.x just will not offer the feature.

Rationale
==
Add benefit of using namespaces in classes. Namespaces allow reusing class names in a separate context, removing the need of class name prefixes and thus increasing overall code readability.

Functionality
==
Today, so-called fully qualified classes can be declared as

```php

```

Real namespace classes can be constructed like this:

```php

```

The directive ```$package= TRUE;``` is necessary for the ClassLoader implementations to detect there's a namespaced class.

Security considerations
==
n/a

Speed impact
==
n/a

Dependencies
==
* Namespace support is only available with PHP >= 5.3.0

Related documents
==