1--TEST-- 2libxml_set_external_entity_loader() error: bad arguments 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7$xml = <<<XML 8<!DOCTYPE foo PUBLIC "-//FOO/BAR" "http://example.com/foobar"> 9<foo>bar</foo> 10XML; 11 12$dd = new DOMDocument; 13$r = $dd->loadXML($xml); 14 15var_dump(libxml_set_external_entity_loader(function($a, $b, $c, $d) {})); 16try { 17 var_dump($dd->validate()); 18} catch (Throwable $e) { 19 echo "Exception: " . $e->getMessage() . "\n"; 20} 21 22echo "Done.\n"; 23?> 24--EXPECTF-- 25bool(true) 26Exception: Too few arguments to function {closure:%s:%d}(), 3 passed and exactly 4 expected 27Done. 28