PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Configuration » Config » Bug #2439

Config_Container countChildren() returns Object when 0 children exist

Details

Submitted2004-10-04 06:27 UTC
FromRyanAMills at gmail dot com
Assignedryansking
StatusClosed
PackageConfig
PHP Version4.3.5
OSWIN32 (XP)
Roadmaps(Not assigned)

Comments

[2004-10-04 06:27 UTC] RyanAMills at gmail dot com

Description:
------------
This only happens on Win32 code. When calling countChildren() on a section, when there are no children, an Object is returned, instead of a numeric 0. It works as expected when it finds any children.

I am using the XML type.

Casting to (int) returns 1.

I need to wrap the following code in order to properly get a 0 returned:

$monthNumberOfPeople = is_numeric($monthSection->countChildren()) ? $monthSection->countChildren() : 0;

Reproduce code:
---------------
$monthNumberOfPeople = $monthSection->countChildren();

[2004-10-14 04:20 UTC] ryansking at mac dot com

Ok, I think I understand the problem now, sorry for the
slowness. What you propose makes sense to me and seems
like the right thing to do. However, I think this change
would be considered a break in backwards compatiblity,
which is only allowed for major version releases.