mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
23 lines
412 B
PHP
23 lines
412 B
PHP
--TEST--
|
|
SimpleXML: overriden count() method
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
class SXE extends SimpleXmlElement {
|
|
public function count() {
|
|
echo "Called Count!\n";
|
|
return parent::count();
|
|
}
|
|
}
|
|
|
|
$str = '<xml><c>asdf</c><c>ghjk</c></xml>';
|
|
$sxe = new SXE($str);
|
|
var_dump(count($sxe));
|
|
?>
|
|
==Done==
|
|
--EXPECT--
|
|
Called Count!
|
|
int(2)
|
|
==Done==
|