xp-framework/xp-framework — pull request #331 by thekid (2013-10-22 07:07:37+00:00)
Title: With

This pull request implements parts of xp-framework/rfc#172 and extends the `with` "statement" to work with `lang.Closeable` instances.

```php
with (new FileReader(__FILE__), new FileWriter('php://stdout'), function($in, $out) {
$out->write($in->read());
});
```

Both readers are closed at the end of the block regardless of whether an exception is raised.