WoltLab/WCF — pull request #1161 by PhrozenByte (2013-02-27 19:22:05+00:00)
Title: Adding the ability to bind objects to callbacks

Unfortunately the "real" support of this was added in PHP 5.4, so we can't use it. This is a way to work around that pitfall. Please note that ```function() use ($this) {}``` doesn't work in PHP 5.3. This suggestion is the same as doing
```php
$callback = function($self) { return $self->someProperty; };
$callback($this);
```
but I think this is a nicer way of doing that - and that's actually the only reason for this ```Callback``` class, isn't it? Naturally you mustn't pass a object, so it's 100% downward-compatible.

Simple usage example:
```php
$callback = new Callback(function($self) { return $self->someProperty; }, $this);
$callback();
```