Getting strange "Unable to open ssh2.sftp://Resource id #3/example.txt" errors? This is a bug in PHP > 5.6.27. Use intval() as a workaround to make ssh2 work again:
$sftp = ssh2_sftp($connection);
fopen("ssh2.sftp://" . intval($sftp) . "/example.txt", 'r');
https://bugs.php.net/bug.php?id=73597