ID:               36210
 User updated by:  urs dot huerlimann at abf dot ch
 Reported By:      urs dot huerlimann at abf dot ch
 Status:           Open
 Bug Type:         Class/Object related
 Operating System: Win2003Server
 PHP Version:      5.1.2
 New Comment:

have not seen your answer, forget my latest comment.
thanks.


Previous Comments:
------------------------------------------------------------------------

[2006-01-30 15:31:36] urs dot huerlimann at abf dot ch

maybe something different with "get_object_vars()"

------------------------------------------------------------------------

[2006-01-30 15:19:17] [EMAIL PROTECTED]

Yes, since 5.1 SimpleXML objects correctly implement count interface.

------------------------------------------------------------------------

[2006-01-30 14:37:18] urs dot huerlimann at abf dot ch

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 this bug report at http://bugs.php.net/?id=36210&edit=1

Reply via email to