Tell Composer to use Different PHP Version
Ubuntu 18.04 case ... this run for me.
/usr/bin/php7.1 /usr/local/bin/composer update
Just add below code to your composer.json file to set different php version:
"config": { "platform": { "php": "7.1.3" }}
On xubuntu I had php 7.2 as default. But needed to run composer with php 5.6.
So this worked for me:
php5.6 /usr/bin/composer