php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch simplexml_countable.patch for SimpleXML related Bug #65215Patch version 2013-07-07 05:24 UTC Return to Bug #65215 | Download this patchThis patch renders other patches obsolete Obsolete patches: Patch Revisions: 2013-07-07 05:24 UTC | 2013-07-07 05:20 UTCDeveloper: ww.galen@gmail.com+#endif sxe_object_handlers.get_method = zend_get_std_object_handlers()->get_method; sxe_object_handlers.get_constructor = zend_get_std_object_handlers()->get_constructor; sxe_object_handlers.get_class_entry = zend_get_std_object_handlers()->get_class_entry; diff --git a/ext/simplexml/tests/countable.phpt b/ext/simplexml/tests/countable.phpt new file mode 100644 index 0000000..7df718a --- /dev/null +++ b/ext/simplexml/tests/countable.phpt @@ -0,0 +1,28 @@ +--TEST-- +SimpleXML: Countable +--SKIPIF-- +<?php +if (!extension_loaded("simplexml")) print "skip"; +if (!extension_loaded('SPL')) print "skip SPL not present"; +?> +--FILE-- +<?php +$xml =<<<EOF +<?xml version='1.0'?> +<!DOCTYPE sxe SYSTEM "notfound.dtd"> +<a> + <b/> + <b/> +</a> +EOF; + +$sxe = new SimpleXMLElement($xml); +var_dump( + $sxe instanceof Countable, + count($sxe) +); +===DONE=== +--EXPECTF-- +bool(true) +int(2) +===DONE=== |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Thu Dec 05 16:01:30 2024 UTC |