mirror of
https://github.com/php/php-src.git
synced 2026-04-18 21:41:22 +02:00
For rationale, see https://github.com/php/php-src/pull/6787 Make extension checks lowercase, add a special case for opcache that has internal name not matching .so filename. Extensions migrated in part 2: * dom * exif * fileinfo * ffi
42 lines
989 B
PHP
42 lines
989 B
PHP
--TEST--
|
|
DOMParentNode: Child Element Handling
|
|
--EXTENSIONS--
|
|
dom
|
|
--FILE--
|
|
<?php
|
|
require_once("dom_test.inc");
|
|
|
|
$dom = new DOMDocument;
|
|
$dom->loadXML('<test></test>');
|
|
|
|
$fragment = $dom->createDocumentFragment();
|
|
$fragment->appendChild($dom->createTextNode('foo'));
|
|
$fragment->appendChild($dom->createElement('bar', 'FirstElement'));
|
|
$fragment->appendChild($dom->createElement('bar', 'LastElement'));
|
|
$fragment->appendChild($dom->createTextNode('bar'));
|
|
|
|
var_dump($fragment instanceof DOMParentNode);
|
|
print_node($fragment->firstElementChild);
|
|
print_node($fragment->lastElementChild);
|
|
var_dump($fragment->childElementCount);
|
|
var_dump($fragment->lastElementChild->firstElementChild);
|
|
var_dump($fragment->lastElementChild->lastElementChild);
|
|
var_dump($fragment->lastElementChild->childElementCount);
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
Node Name: bar
|
|
Node Type: 1
|
|
Num Children: 1
|
|
Node Content: FirstElement
|
|
|
|
Node Name: bar
|
|
Node Type: 1
|
|
Num Children: 1
|
|
Node Content: LastElement
|
|
|
|
int(2)
|
|
NULL
|
|
NULL
|
|
int(0)
|