xref: /PHP-8.0/ext/simplexml/tests/036.phpt (revision dabc28d1)
1--TEST--
2SimpleXML: overridden 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--EXPECT--
19Called Count!
20int(2)
21