thekid/rfc — Issue #172: RFC 0172: XP 6
Author: thekid
Created: 2011-10-09 15:34:33+00:00
State: open

Scope of Change
====
The next major XP framework release will bring a magnitude of new
features.

Rationale
====
This RFC gives a strategic outlook to the further development.

Functionality
====

Due to its requirements on PHP 5.3, the XP 5 series will be continued
(not indefinitely, but for at least a year). The XP 6 series are not
backwards compatible - code written in XP 5 will not work and will need
to be converted.

Namespaces
----
All XP classes will be inside namespaces. This supersedes the functionality
implemented in xp-framework/rfc #37 and makes all classnames always fully qualified
(but allows for short notation by using "use").

Declaration:

```php

```

Usage:

```php

```

Singleton base class
----
There will be a new base class for all singletons.

```php
log('Hello');

// Fatal error: Call to private Singleton::__construct
// new Logger();

// Fatal error: Call to private Singleton::__clone
// clone Logger::getInstance();
?>
```

See http://news.xp-framework.net/article/274/2008/08/23/

Enums
----
Enum declarations will become easier.

Most simple use-case:

```php

```

See http://news.xp-framework.net/article/272/2008/08/12/

Class member
----
All classes will have a static class member pointing to a lang.XPClass
instance.

```php

?>
```

Using
----
A new using() statement will be added. It will close any given arguments
by calling their close() method after the closure given has finished
running.

```php
write($in->read());
});
?>
```

Unicode
----
Unicode (see xp-framework/rfc #146) support will be added in a later release of XP 6
and increase the minor version:

Timeline:

```
Unicode
vvvvvv
...- XP 5.7 -+--------- XP 5.8 -...
|
XP 6.0 --- XP 6.1 -...

```

Security considerations
====
n/a

Speed impact
====
n/a

Dependencies
====

Engine
----
The XP Framework will require the newest version of PHP.

* PHP 5.3 - for namespaces, late static binding, closures
* __getStatic() patch - for ::$class

Deprecations
----
The following are no longer needed or required:

* The uses() statement (replaced by "use" and __autoload)
* xp-framework/rfc #37 (superseded by namespaces)
* Enum::values() in declaration (made unnecessary by late static binding)

BC problems
----
These issues are to be considered problematic:

* Serialization format has changed in PHP 5.3
* All classes are now namespaced, cases where the unqualified class names
are used need to be changed

Related documents
====
Namespaces
----
See xp-framework/rfc #136

__getStatic() patch
----
http://sitten-polizei.de/php/getstatic.diff

PHP 5.3 experiments
----
http://experiments.xp-forge.net/xml/browse?arena,five3

Comments
====