xp-framework/core — pull request #1 by thekid (2013-11-12 23:16:32+00:00)
Title: RFC 279: Newinstance with closures

This pull request implements xp-framework/rfc#279 and adds closure support to `newinstance`.

## Old

```php
$handler= newinstance('lang.reflect.InvocationHandler', array(), '{
public $invocations= array();
public function invoke($proxy, $method, $args) {
$this->invocations[$method."_".sizeof($args)]= $args;
}
);
```

## New

```php
$handler= newinstance('lang.reflect.InvocationHandler', array(), array(
'invocations' => array(),
'invoke' => function($self, $proxy, $method, $args) {
$self->invocations[$method.'_'.sizeof($args)]= $args;
}
);
```