ID:               30391
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         SimpleXML related
 Operating System: Irrelevant
 PHP Version:      5CVS-2004-10-11 (dev)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

SimpleXML creates dynamic objects, array functions will not work on
these.


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

[2004-10-11 09:13:22] [EMAIL PROTECTED]

Description:
------------
is_array() does not work on member arrays of SimpleXMLElement objects.

Reproduce code:
---------------
<?php
$foo = simplexml_load_string(
'<?xml version="1.0" encoding="iso-8859-1" ?>

<foo>
  <bar>
    <barbara>barbara</barbara>
  </bar>
  <bar>
    <barbara>barbara</barbara>
    <barbara>barbara</barbara>
  </bar>
</foo>');

foreach ($foo->bar as $bar) {
    var_dump(is_array($bar->barbara));
    var_dump($bar);
}
?>

Expected result:
----------------
bool(false)
object(SimpleXMLElement)#4 (1) {
  ["barbara"]=>
  string(7) "barbara"
}
bool(true)
object(SimpleXMLElement)#5 (1) {
  ["barbara"]=>
  array(2) {
    [0]=>
    string(7) "barbara"
    [1]=>
    string(7) "barbara"
  }
}

Actual result:
--------------
bool(false)
object(SimpleXMLElement)#4 (1) {
  ["barbara"]=>
  string(7) "barbara"
}
bool(false)
object(SimpleXMLElement)#5 (1) {
  ["barbara"]=>
  array(2) {
    [0]=>
    string(7) "barbara"
    [1]=>
    string(7) "barbara"
  }
}


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


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

Reply via email to