1--TEST-- 2DOMComment::appendData basic functionality test 3--CREDITS-- 4Mike Sullivan <mike@regexia.com> 5#TestFest 2008 (London) 6--SKIPIF-- 7<?php require_once('skipif.inc'); ?> 8--FILE-- 9<?php 10 11$document = new DOMDocument; 12$root = $document->createElement('root'); 13$document->appendChild($root); 14 15$comment = $document->createElement('comment'); 16$root->appendChild($comment); 17 18$commentnode = $document->createComment(''); 19$comment->appendChild($commentnode); 20$commentnode->appendData('data'); 21echo "Comment Length (one append): " . $commentnode->length . "\n"; 22 23$commentnode->appendData('><&"'); 24echo "Comment Length (two appends): " . $commentnode->length . "\n"; 25 26echo "Comment Content: " . $commentnode->data . "\n"; 27 28echo "\n" . $document->saveXML(); 29 30?> 31--EXPECT-- 32Comment Length (one append): 4 33Comment Length (two appends): 8 34Comment Content: data><&" 35 36<?xml version="1.0"?> 37<root><comment><!--data><&"--></comment></root>