|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchessimplexml_countable.patch (last revision 2013-07-07 05:24 UTC by ww dot galen at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-05-31 17:23 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: cmb
[2019-05-31 17:23 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ SimpleXMLElement is essentially a Countable (it matches the signature of the interface), but doesn't register as implementing it. The attached (untested) patch should register SimpleXMLElement as a Countable if SPL is also being built. It does not cover the case where someone builds SPL as a shared extension (does anyone do that?). Test script: --------------- <?php $x = new SimpleXMLElement('<?xml version="1.0"?><a><b/><c/></a>'); var_dump(count($x), $x instanceof Countable); Expected result: ---------------- int(2) bool(true) Actual result: -------------- int(2) bool(false)