csaoh/react — pull request #3 by igorw (2013-04-13 10:28:53+00:00)
Title: Retain reference to lambda to prevent it from being gc'd early

If the refcount of a lambda goes to 0 from within the event loop, it tries to
garbage collect it from within the zend engine. However, this breaks if that
lambda is on the call stack.

To prevent this condition, the lambda must hold a reference to itself until
it exits, at which point the refcount goes to 0 and it can be naturally
garbage collected.