#36210 [NEW]: different result of count in 5.1.2

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


#36210 [Bgs-Opn]: different result of count in 5.1.2

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

maybe something different with get_object_vars()


Previous Comments:


[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=36210edit=1


#36210 [Opn]: different result of count in 5.1.2

2006-01-30 Thread urs dot huerlimann at abf dot ch
 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=36210edit=1


#36210 [Opn-Csd]: different result of count in 5.1.2

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

So we have to implement different versions depending on our customers
php versions...

;-) thanks for your fast answer.
urs hürlimann


Previous Comments:


[2006-01-30 15:34:25] urs dot huerlimann at abf dot ch

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



[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=36210edit=1