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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
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:
69.69 ms | 407 KiB | 5 Q