nikic/scalar_objects — pull request #12 by thekid (2014-04-27 21:57:25+00:00)
Title: Refactor: Handler instances self param

This pull request refactors the API to pass the value the method is invoked on as first argument to handlers' methods instead of filling in `$this` with it. This way, we're able to overcome the limitation of not being able to modify the value in PHP >= 5.6.0 (making the `array_pop` example work once again) and gets rid of segmentation faults when PHP relies on `$this` being an object.

## Old
```php
class StringHandler {
public function length() {
return strlen($this);
}
}
```

## New
```php
class StringHandler {
public function length($self) {
return strlen($self);
}
}
```