porting from github.com/mmckinst/php54-pecl-ssh2