1--TEST-- 2DOMNode::C14N() 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7$xml = <<< XML 8<?xml version="1.0" ?> 9<books> 10 <book> 11 <title>The Grapes of Wrath</title> 12 <author>John Steinbeck</author> 13 </book> 14 <book> 15 <title>The Pearl</title> 16 <author>John Steinbeck</author> 17 </book> 18</books> 19XML; 20 21$doc = new DOMDocument(); 22$doc->loadXML($xml); 23$node = $doc->getElementsByTagName('title')->item(0); 24var_dump($node->C14N()); 25 26try { 27 var_dump($node->C14N(false, false, [])); 28} catch (\ValueError $e) { 29 echo $e->getMessage() . \PHP_EOL; 30} 31try { 32 var_dump($node->C14N(false, false, ['query' => []])); 33} catch (\TypeError $e) { 34 echo $e->getMessage() . \PHP_EOL; 35} 36?> 37--EXPECT-- 38string(34) "<title>The Grapes of Wrath</title>" 39DOMNode::C14N(): Argument #3 ($xpath) must have a "query" key 40DOMNode::C14N(): Argument #3 ($xpath) "query" option must be a string, array given 41