I'm currently implementing a PHP anonymus function.
class bar {
public function foo()
{
$start = 1;
add_one(function() {
$start++;
})
}
}
function add_one($func) {
$func();
}
This return an error because $start is actually defined outside from the anonymus function, its not a local variable in the anonymus function. anybody can solve this ?, how to pass the value ?
Thanks.