phpseclib/phpseclib — pull request #349 by terrafrost (2014-05-26 22:39:34+00:00)
Title: SSH2: make it so callback functions can make exec() return early

One of the problems with http://phpseclib.sourceforge.net/ssh/examples.html#callback is that it can't make exec() return early. ie. with that code sample it'll just loop endlessly. With this change you could make the callback function return true after that function has been called 10x times and then the exec() function would return control to the program.