mirror of
https://github.com/php/php-src.git
synced 2026-04-19 22:11:12 +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
39 lines
839 B
PHP
39 lines
839 B
PHP
--TEST--
|
|
Bug #79852: count(DOMNodeList) doesn't match count(IteratorIterator(DOMNodeList))
|
|
--EXTENSIONS--
|
|
dom
|
|
--FILE--
|
|
<?php
|
|
|
|
$XML = <<< XML
|
|
<root>
|
|
<item>1</item>
|
|
<item>2</item>
|
|
<item>3</item>
|
|
</root>
|
|
XML;
|
|
|
|
$dom = new DomDocument();
|
|
$dom->loadXml($XML);
|
|
$items = $dom->getElementsByTagName('item');
|
|
|
|
echo "Count: ".count($items)."\n";
|
|
echo "Count: ".iterator_count($items->getIterator())."\n";
|
|
$it = new IteratorIterator($items);
|
|
echo "Count: ".iterator_count($it)."\n";
|
|
echo "Count: ".iterator_count($it)."\n";
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Count: 3
|
|
Count: 3
|
|
Count: 3
|
|
|
|
Fatal error: Uncaught Error: Iterator does not support rewinding in %s:%d
|
|
Stack trace:
|
|
#0 [internal function]: InternalIterator->rewind()
|
|
#1 [internal function]: IteratorIterator->rewind()
|
|
#2 %s(%d): iterator_count(Object(IteratorIterator))
|
|
#3 {main}
|
|
thrown in %s on line %d
|