3v4l.org

run code in 300+ PHP versions simultaneously
<?php libxml_set_external_entity_loader(function ($public_id, $system_id, $context) { var_dump($public_id, $system_id, $context); return "other"; }); $doc = new DOMDocument; $doc->loadHTMLFile("foobar");
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
NULL string(6) "foobar" array(4) { ["directory"]=> NULL ["intSubName"]=> NULL ["extSubURI"]=> NULL ["extSubSystem"]=> NULL } Warning: DOMDocument::loadHTMLFile(): I/O warning : failed to load external entity "other" in /in/rJTTc on line 9

preferences:
118.04 ms | 402 KiB | 90 Q