How can I run Drush 8 and Drush 9 together on same machine to test some module on it? As in my earlier environment I was running Drush 6 and Drush 8 together.

I need help with the Drush 8 and Drush 9 installation. Is there any possible way to achieve it?

I tried to do porting command following Porting Commands to Drush 9, without success.

Any help would be appreciated.
Install Drush 8 by downloading the phar file as recommended in the documentation. Rename the phar file to drush8, not drush.

Install Drush 9 as recommened in the documentation. I strongly recommend to install Drush Launcher globally using a phar file as documented and only install Drush site local. This is very easy if you are already using Composer to maintain your Drupal site. If you aren't using Composer to maintain your site, you can just as well install Drush 9 globally using Composer and forget about Drush Launcher.