<?php
class foo{
public $bar = NULL;
public function boo(){
$haha = $this->bar;
$haha();
}
}
$mee = new foo();
//save a closure function on the property
$mee->bar = function(){
echo 'hahaha';
};
//invoke the closure function by using a class method
$mee->boo();
?>