title: PHPUnit Cannot acquire reference to $GLOBALS
body: <p>I am getting an error when running PHPUnit tests on GitHub actions.</p>
  <pre><code>PHP Fatal error:  Cannot acquire reference to $GLOBALS in /home/runner/work/project-name/project-name/vendor/phpunit/phpunit/src/Util/Configuration.php on line 570
  </code></pre>
  <p>It seems like this error is likely related to PHP8 (<a href="https://php.watch/versions/8.1/GLOBALS-restrictions" rel="noreferrer">https://php.watch/versions/8.1/GLOBALS-restrictions</a>), but the test matrix should only be running PHP 7.2 and 7.4 (tests run fine locally on PHP 7.4).</p>
  <p>Error shown here in <a href="https://github.com/devinsays/woocommerce-coupon-restrictions/runs/4611622660?check_suite_focus=true" rel="noreferrer">GitHub Actions</a>. <a href="https://github.com/devinsays/woocommerce-coupon-restrictions/blob/master/.github/workflows/php-tests.yml" rel="noreferrer">Testing matrix is here</a>.</p>
  <p>Any help much appreciated!</p>
  <p>--</p>
  <p>Edit:</p>
  <p>Resolved this by specifically setting the PHP Version in the container as the first step:</p>
  <pre><code># PHPUnit errors with latest PHP 8.X build.
  # This specifically sets PHP version to 7.4.
  - name: Setup PHP with tools
  uses: shivammathur/setup-php@v2
  with:
      php-version: '7.4'
      tools: phpunit
  </code></pre>