PHP LIBXML_NOWARNING not suppressing warnings?
问题 Using the LIBXML_NOWARNING options flag doesn't stop wanrings when loading html with PHPDOMDocument->loadHTML. Other constants do work though. In the example below I add the LIBXML_HTML_NODEFDTD to prove that the constants are received(stops a doctype from being added). $doc=new DOMDocument(); $doc->loadHTML("<tagthatdoesnotexist><h1>Hi</h1></tagthatdoesnotexist>",LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_HTML_NODEFDTD); echo $doc->saveHTML(); However, warnings are still generated and output