title: DOMDocument parse and validateOnParse succeeds, parse and validate separately fails
body: <p>Here is the html file I am trying to validate:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;title&gt;Valid HTML4&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;p&gt;Such tidy&lt;/p&gt;
      &lt;p&gt;Amaze&lt;/p&gt;
      &lt;p&gt;Much HTML4&lt;/p&gt;
      &lt;p&gt;Wow&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have manually checked its validity against the w3c validator (<a href="https://validator.w3.org/check" rel="nofollow noreferrer">https://validator.w3.org/check</a>).</p>
  
  <p>this "method of validation" succeeds ($string holds the contents of the above file):</p>
  
  <pre><code>    $dom = new \DOMDocument();
      $dom-&gt;validateOnParse = true;
      // this succeeds
      $dom-&gt;loadHTML($string));
  </code></pre>
  
  <p>this "method of validation" fails:</p>
  
  <pre><code>   $dom = new \DOMDocument();
     $dom-&gt;loadHTML($string);
     // this fails
     $dom-&gt;validate(); 
  </code></pre>
  
  <p>further background: php 7.4, LibXML 2.9+.  Windows 10.  Because of the delays built into the W3 server(s), I have tried to validate the file two ways:  the first is by letting the request go out to the W3 server (takes about a minute).  LibXML error message reports "failed to load external entity <a href="http://www.w3.org/TR/html4/strict.dtd" rel="nofollow noreferrer">http://www.w3.org/TR/html4/strict.dtd</a>".  The second method is by setting up an xml catalog in order to cache a local copy of strict.dtd.  In this instance I get an odd parser error at line 81 of strict.dtd where it complains that the entity Content-Type is not properly terminated.</p>
  
  <p>It is important to me to be able to validate separately from parsing. Any help would be great.</p>