You can also access private data:
<?php
class Value {
private $value;
public function __construct($value) {
$this->value = $value;
}
}
$foo = new Value('Foo');
$bar = new Value('Bar');
$closure = function () { var_dump($this->value); };
$closure->call($foo);
$closure->call($bar);
?>
Output:
string(3) "Foo"
string(3) "Bar"