1--TEST--
2libxml_set_external_entity_loader() error: bad arguments
3--SKIPIF--
4<?php if (!extension_loaded('dom')) die('skip dom extension not available'); ?>
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--EXPECT--
25bool(true)
26Exception: Too few arguments to function {closure}(), 3 passed and exactly 4 expected
27Done.
28