<?php
class Foo
{
private $value;
public function __construct($value)
{
$this->value = $value;
}
}
$foo = new Foo('string');
// Instead of bind to closure you can use call in php 7
$closure = function() {
return md5($this->value);
};
var_dump($closure->call($foo));