php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #65215
Patch simplexml_countable.patch revision 2013-07-07 05:24 UTC by ww dot galen at gmail dot com
revision 2013-07-07 05:20 UTC by ww dot galen at gmail dot com

Patch simplexml_countable.patch for SimpleXML related Bug #65215

Patch version 2013-07-07 05:24 UTC

Return to Bug #65215 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2013-07-07 05:24 UTC | 2013-07-07 05:20 UTC

Developer: 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===
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 11:01:33 2024 UTC