\[quote\] Note: I have condensed this article into my person wiki: http://wiki.chacha102.com/Lambda - Enjoy\[/quote\]I am having some troubles with Lambda style functions in PHP.First, This Works:\[code\]$foo = function(){ echo "bar"; };$foo();\[/code\]Second, This Works:\[code\]class Bar{ public function foo(){ echo "Bar"; }\[/code\]Third, This works:\[code\]$foo = new stdClass;$foo->bar = function(){ echo "bar"; };$test = $foo->bar;$test();\[/code\]But, this does not work:\[code\]$foo = new stdClass;$foo->bar = function(){ echo "bar"; };$foo->bar();\[/code\]And, this does not work\[code\]class Bar{ public function foo(){ echo "Bar"; }$foo = new Bar;$foo->foo = function(){ echo "foo"; };$foo->foo(); // echo's bar instead of Foo.\[/code\]My Question is Why?, and how can I assure that both this:\[code\]$foo->bar = function(){ echo "test"; };$foo->bar();\[/code\]and this\[code\]$foo = new Bar;$foo->bar();\[/code\]are called properly? Extra Points if you can point to documentation stating why this problem occurs.