summaryrefslogtreecommitdiff
path: root/ext/dom/tests/DOMNamedNodeMap_count.phpt
blob: 656dd4859efc9cc715f8bd9058775355fb8344aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Test count nodes in DOMNamedNodeMap
--CREDITS--
Andreas Treichel <gmblar+github@gmail.com>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php

$document = new DomDocument();
$root = $document->createElement('root');
$document->appendChild($root);
for($i = 0; $i < 5; $i++) {
    $root->setAttribute('attribute-' . $i, 'value-' . $i);
}
for($i = 0; $i < 7; $i++) {
    $item = $document->createElement('item');
    $root->appendChild($item);
}
var_dump($root->attributes->length);
var_dump($root->attributes->count());
var_dump(count($root->attributes));

?>
--EXPECTF--
int(5)
int(5)
int(5)