phpseclib/phpseclib — pull request #591 by cnelissen (2014-12-30 00:06:05+00:00)
Title: Convert Base::_createInlineCryptFunction to use PHP 5 anonymous functions instead of create_function

This PR converts Base::_createInlineCryptFunction to use native PHP 5 anonymous functions instead of the PHP 4 create_function method. This is necessary for adding proper support for visibility statements throughout the codebase as the old lambda functions were not scope-aware and were causing visibility conflicts.

Additionally, the anonymous functions are showing a significant performance gain. Running the unit tests on the current version yields memory usage of 21.75Mb and running against this PR yields memory usage of 17.75Mb.

I am planning on further converting these functions to get rid of using eval statements, but I figured this should be good for a single PR.