[PHP-BUG] Bug #64917 [NEW]: Infinite loop when using SimpleXMLElement::attributes

2013-05-24 Thread nabice at gmail dot com
From: nabice at gmail dot com
Operating system: Linux 3.8.0
PHP version:  5.4.15
Package:  SimpleXML related
Bug Type: Bug
Bug description:Infinite loop when using SimpleXMLElement::attributes

Description:

When I use SimpleXML to find some element's attributes, A mistake leads to

infinite loop.

I was meaning "$child->atttibutes()", but "$childs->attributes()" by
mistake, 
then some strange things happen: Infinite loop.

Is it a bug?

Test script:
---
');
$childs = $xml->parent->child;
foreach($childs as $child){
var_dump($childs->attributes());
}
?>

Expected result:

Print:

object(SimpleXMLElement)#6 (1) {
  ["@attributes"]=>
  array(1) {
["id"]=>
string(1) "1"
  }
}
object(SimpleXMLElement)#6 (1) {
  ["@attributes"]=>
  array(1) {
["id"]=>
string(1) "1"
  }
}

Actual result:
--
Infinite loop.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64917&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64917&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64917&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=64917&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=64917&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=64917&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64917&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=64917&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=64917&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=64917&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=64917&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64917&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64917&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=64917&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64917&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=64917&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=64917&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=64917&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64917&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64917&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64917&r=mysqlcfg



[PHP-BUG] Bug #64918 [NEW]: Infinite loop when using SimpleXMLElement::attributes

2013-05-24 Thread nabice at gmail dot com
From: nabice at gmail dot com
Operating system: Linux 3.8.0
PHP version:  5.4.15
Package:  SimpleXML related
Bug Type: Bug
Bug description:Infinite loop when using SimpleXMLElement::attributes

Description:

When I use SimpleXML to find some element's attributes, A mistake leads to

infinite loop.

I was meaning "$child->atttibutes()", but "$childs->attributes()" by
mistake, 
then some strange things happen: Infinite loop.

Is it a bug?

Test script:
---
');
$childs = $xml->parent->child;
foreach($childs as $child){
var_dump($childs->attributes());
}
?>

Expected result:

Print:

object(SimpleXMLElement)#6 (1) {
  ["@attributes"]=>
  array(1) {
["id"]=>
string(1) "1"
  }
}
object(SimpleXMLElement)#6 (1) {
  ["@attributes"]=>
  array(1) {
["id"]=>
string(1) "1"
  }
}

Actual result:
--
Infinite loop.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64918&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64918&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64918&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=64918&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=64918&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=64918&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64918&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=64918&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=64918&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=64918&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=64918&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64918&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64918&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=64918&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64918&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=64918&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=64918&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=64918&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64918&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64918&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64918&r=mysqlcfg



Bug #64918 [Com]: Infinite loop when using SimpleXMLElement::attributes

2013-05-24 Thread nabice at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=64918&edit=1

 ID: 64918
 Comment by: nabice at gmail dot com
 Reported by:nabice at gmail dot com
 Summary:Infinite loop when using
 SimpleXMLElement::attributes
 Status: Duplicate
 Type:   Bug
 Package:SimpleXML related
 Operating System:   Linux 3.8.0
 PHP Version:5.4.15
 Block user comment: N
 Private report: N

 New Comment:

Sorry, I thought I failed to submit 64917, so I submit this one.


Previous Comments:

[2013-05-24 15:38:43] ahar...@php.net

Note to self: "submitted twice" isn't very useful. Sorry about the bugspam.

Duplicate of bug #64917, anyway.


[2013-05-24 15:38:14] ahar...@php.net

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.




[2013-05-24 13:18:41] nabice at gmail dot com

Description:

When I use SimpleXML to find some element's attributes, A mistake leads to 
infinite loop.

I was meaning "$child->atttibutes()", but "$childs->attributes()" by mistake, 
then some strange things happen: Infinite loop.

Is it a bug?

Test script:
---
');
$childs = $xml->parent->child;
foreach($childs as $child){
var_dump($childs->attributes());
}
?>

Expected result:

Print:

object(SimpleXMLElement)#6 (1) {
  ["@attributes"]=>
  array(1) {
["id"]=>
string(1) "1"
  }
}
object(SimpleXMLElement)#6 (1) {
  ["@attributes"]=>
  array(1) {
["id"]=>
string(1) "1"
  }
}

Actual result:
--
Infinite loop.






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64918&edit=1