Viewing application/octet-stream


PHP 5.3 Experiments

This directory is intended to hold experiments with the new PHP version.

Namespaces

The "namespaces" directory contains a preview of what namespaced code will look like in XP6.

  namespace util;

use lang::IllegalArgumentException;

class Date extends lang::Object {

// ...

}

Lambda

This directory explores what is possible with the new lambda/closure support added in 5.3.

For example, a using statement could be added which closes objects automatically when leaving its scope:

  using(new FileReader($fi), new FileWriter($fo), function($in, $out) {
$out->write($in->read());
});

Late static binding

The so-called "late static binding" features allows for inheritance of static methods and members.

One use of this is:

  class Logger extends Singleton {
public function log($arg) {
// ...
}
}

Logger::getInstance
()->log('Hello');

Download

You can download the file «README» by using this link.