Tutorial on export/import Translation giving PHP error

I’m adding a Spanish version to my website and am trying to export my English version into JSON so it can then be translated into Spanish and reimported. I’m following this guide here: Import/export translations | Kirby CMS

But after creating scripts/translation-export.php and running ./translation-export.php I get the following error in my terminal:

  <p class="notice">
    This page is currently offline. We are very sorry for the inconvenience and will fix it as soon as possible.
  </p>
  <p class="admin-advice">
    Advice for developers and administrators:<br>
    Change the PHP version to 7.2, 7.3 or 7.4 (PHP 7.3 or 7.4 are recommended)

Though when I check bootstrap, it’s set to 7.2 and my MAMP PHP version is also 7.4.9.

When you type php -v on the command line, what is the result?

Ah okay it says PHP 7.1.32 (cli) (built: Oct 2 2019 02:04:02) ( NTS )

Since we are running a bash script with PHP in the CLI, the CLI version of PHP is relevant, not the version used by Mamp.

So for the script to work, you would have to update PHP.