title: PHPUnit - Invalid argument supplied for foreach() not recognized despite expecting it
body: <p>all...my subject says it all. I'm trying to do a test that actually <em>intentionally makes</em> "Invalid argument supplied for foreach()" happen. I'm trying to get PHPUnit to <em>expect</em> it, but...nope, my tests still come to a screeching halt. The reason: "invalid argument supplied for foreach()" right at the exact point where I'm <em>telling it</em> that it's going to happen.</p>
  
  <p>At the top of my file I have:</p>
  
  <pre><code>use PHPUnit\Framework\TestCase;
  use PHPUnit\Framework\Error\Error;
  use PHPUnit\Framework\Error\Notice;
  use PHPUnit\Framework\Error\Warning;
  </code></pre>
  
  <p>My class declaration starts with:</p>
  
  <pre><code>Class flirzelkwerpTest extends TestCase {
  </code></pre>
  
  <p>Here are the lines in the test file:</p>
  
  <pre><code>    // Let's try to add nothing.
      // (It should throw an error because of "Invalid argument supplied for foreach()" in barabajagal.php.)
      $this-&gt;expectException(\InvalidArgumentException::class);
      $this-&gt;expectExceptionMessage('Invalid argument supplied for foreach()');
      $resp = $barabajagal-&gt;add();
  </code></pre>
  
  <p>The error happens on that last line. Shouldn't the previous two lines be telling PHPUnit, "Hey, bub, I expect there to be an error here, and this is the message you should be getting verbatim"??</p>
  
  <p>We're using PHP 7.3.4 and PHPUnit 8.3.2.</p>