1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 14:31:06 +02:00
Files
archived-php-src/ext/simplexml/tests/sxe_005.phpt
Christoph M. Becker dabc28d182 Fix #78880: Spelling error report
We fix the most often occuring typos according to a recent codespell
report[1] in tests, code comments and documentation.

[1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
2019-12-21 11:58:00 +01:00

43 lines
603 B
PHP

--TEST--
SPL: SimpleXMLIterator and overridden count()
--SKIPIF--
<?php
if (!extension_loaded('simplexml')) print 'skip';
if (!extension_loaded("libxml")) print "skip LibXML not present";
?>
--FILE--
<?php
$xml =<<<EOF
<?xml version='1.0'?>
<sxe>
<elem1/>
<elem2/>
<elem2/>
</sxe>
EOF;
class SXETest extends SimpleXMLIterator
{
function count()
{
echo __METHOD__ . "\n";
return parent::count();
}
}
$sxe = new SXETest($xml);
var_dump(count($sxe));
var_dump(count($sxe->elem1));
var_dump(count($sxe->elem2));
?>
--EXPECT--
SXETest::count
int(3)
SXETest::count
int(1)
SXETest::count
int(2)