I have a weird problem trying to use closures in PHP. When assigning a closure to a variable, I get a null value. But when displaying the closure with var_dump(), everything is alright.
Here is a source code that summarizes the problem:
$f = function() {}; var_dump($f); // 'null' var_dump(function() {}); // 'object(Closure)[1]' I'm using PHP 5.3.1.
Edit: I forgot to mention, I have this problem only when I'm using PHP via Apache. I don't have issues when using PHP CLI.