Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.12

Bug #2439 Config_Container countChildren() returns Object when 0 children exist
Submitted: 2004-10-04 06:27 UTC
From: RyanAMills at gmail dot com Assigned: ryansking
Status: Closed Package: Config
PHP Version: 4.3.5 OS: WIN32 (XP)
Roadmaps: (Not assigned)    
Subscription  


 [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();

Comments

 [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.