xref: /PHP-7.0/ext/simplexml/tests/036.phpt (revision 003841e3)
1--TEST--
2SimpleXML: overriden count() method
3--SKIPIF--
4<?php if (!extension_loaded("simplexml")) print "skip"; ?>
5--FILE--
6<?php
7class SXE extends SimpleXmlElement {
8    public function count() {
9        echo "Called Count!\n";
10        return parent::count();
11    }
12}
13
14$str = '<xml><c>asdf</c><c>ghjk</c></xml>';
15$sxe = new SXE($str);
16var_dump(count($sxe));
17?>
18==Done==
19--EXPECT--
20Called Count!
21int(2)
22==Done==
23