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