From:             urs dot huerlimann at abf dot ch
Operating system: Win2003Server
PHP version:      5.1.2
PHP Bug Type:     Class/Object related
Bug description:  different result of count in 5.1.2 

Description:
------------
count of an xml-object returns different result in 5.1.2 and 5.0.4:

is there any bugfix in 5.1.2 that causes this behavior?

[5.0.4] the structure looks like:
object(SimpleXMLElement)#15 (6) {
  ["SaveMode"]=>
  string(6) "Insert"
  ["ManCd"]=>
  string(3) "BAG"
  ["RegNr"]=>
  string(47) "5_0x2E460x2E46_90_0x2E460x2E46_07_0x2E460x2E46_"
  ["DosNr"]=>
  string(16) "_0x2D450x2D45_43"
  ["Verantw"]=>
  string(6) "BAG070"
  ["Titel"]=>
  string(124) "105228 _0x7C1240x7C124_ WERT_CASNR _0x7C1240x7C124_
WERT_ECNR _0x7C1240x7C124_ WERT_REGISTERNR _0x7C1240x7C124_ WERT_BEZNAME"
}

=====================================================
[5.1.2] similar structure looks like
object(SimpleXMLElement)#18 (6) {
  ["SaveMode"]=>
  string(6) "Insert"
  ["ManCd"]=>
  string(3) "BAG"
  ["RegNr"]=>
  string(47) "5_0x2E460x2E46_90_0x2E460x2E46_33_0x2E460x2E46_"
  ["DosNr"]=>
  string(15) "_0x2D450x2D45_1"
  ["Verantw"]=>
  string(6) "BAG070"
  ["Titel"]=>
  string(146) "3694 _0x7C1240x7C124_ 115_0x2D450x2D45_09_0x2D450x2D45_3
_0x7C1240x7C124_ 204_0x2D450x2D45_064_0x2D450x2D45_2 _0x7C1240x7C124_
chloromethylmercury"
}

Reproduce code:
---------------
SimpleXMLElement has six entries.

$a = new array();
$a[]=$SimpleXMLElement;
(...)
foreach($a as $detail)
{
  echo(count($detail));
}


Expected result:
----------------
twice the same result

Actual result:
--------------
5.0.4::count -> 1
5.1.2::count -> 6

-- 
Edit bug report at http://bugs.php.net/?id=36210&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36210&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36210&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36210&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36210&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36210&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36210&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36210&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36210&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36210&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36210&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36210&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36210&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36210&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36210&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36210&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36210&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36210&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36210&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36210&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36210&r=mysqlcfg

Reply via email to