<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=XML_Serializer</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/21173" />
      <rdf:li rdf:resource="http://pear.php.net/bug/21052" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18652" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18395" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18359" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17636" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17577" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17281" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16979" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16618" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16588" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16402" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16204" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16153" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15670" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14112" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/21173">
      <title>XML_Serializer: Feature/Change Request 21173 [Open] XML unserializing with namespaced class names using tagmap</title>
      <link>http://pear.php.net/bugs/21173</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by archana_m
2017-01-30T05:06:53+00:00
PHP: 5.5.24 OS: Windows 7 Package Version: SVN

Description:
------------
I am trying to deserialize xml into object using namespaced classes. 
mentioning structure which is expected as below. Please help me 
with it if there is any possible solution or any option changes 
required in unserializing options. My current defined options are as 
follows:

public $options_unserialize = array (
			// Defines whether nested tags should be returned 
as associative arrays or objects.
			XML_UNSERIALIZER_OPTION_COMPLEXTYPE =&gt; 
'object',
			
			// use the tagname as the classname
			
XML_UNSERIALIZER_OPTION_TAG_AS_CLASSNAME =&gt; true,
			
			// specify the target encoding
			
XML_UNSERIALIZER_OPTION_ENCODING_TARGET =&gt; &quot;UTF-8&quot;,
			
			// unserialize() returns the result of the 
unserialization instead of true
			XML_UNSERIALIZER_OPTION_RETURN_RESULT 
=&gt; true,
			
			// remove whitespace around data
			XML_UNSERIALIZER_OPTION_WHITESPACE =&gt; 
XML_UNSERIALIZER_WHITESPACE_TRIM,
			
			 
XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE    =&gt; true
		);

Test script:
---------------
$tagMapArray = array(&quot;Foo&quot; =&gt; &quot;MyNameSpace\Classes\Foo&quot;, &quot;Bar&quot;=&gt;&quot;MyNameSpace\Classes\Bar&quot;);

$this-&gt;options_unserialize['tagMap'] = $tagMapArray;

$unserializer = new XML_Unserializer($this-&gt;options_unserialize);
$result_unserialize = $unserializer-&gt;unserialize($xmlResponse,false);



Expected result:
----------------
[Foo] =&gt; MyNameSpace\Classes\Foo Object
		(
			[Bar] =&gt; MyNameSpace\Classes\Bar Object
						(
							[Name] =&gt; &quot;ABC&quot;
						)
		)
		

Actual result:
--------------
[Foo]=&gt;
[MyNameSpace\Classes\Foo] =&gt; MyNameSpace\Classes\Foo Object
		(
	[Bar] =&gt;			
	[MyNameSpace\Classes\Bar] =&gt; MyNameSpace\Classes\Bar 
Object
						(
							[Name] =&gt; &quot;ABC&quot;
						)

				)

		)</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by archana_m
2017-01-30T05:06:53+00:00
PHP: 5.5.24 OS: Windows 7 Package Version: SVN

Description:
------------
I am trying to deserialize xml into object using namespaced classes. 
mentioning structure which is expected as below. Please help me 
with it if there is any possible solution or any option changes 
required in unserializing options. My current defined options are as 
follows:

public $options_unserialize = array (
			// Defines whether nested tags should be returned 
as associative arrays or objects.
			XML_UNSERIALIZER_OPTION_COMPLEXTYPE =&gt; 
'object',
			
			// use the tagname as the classname
			
XML_UNSERIALIZER_OPTION_TAG_AS_CLASSNAME =&gt; true,
			
			// specify the target encoding
			
XML_UNSERIALIZER_OPTION_ENCODING_TARGET =&gt; &quot;UTF-8&quot;,
			
			// unserialize() returns the result of the 
unserialization instead of true
			XML_UNSERIALIZER_OPTION_RETURN_RESULT 
=&gt; true,
			
			// remove whitespace around data
			XML_UNSERIALIZER_OPTION_WHITESPACE =&gt; 
XML_UNSERIALIZER_WHITESPACE_TRIM,
			
			 
XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE    =&gt; true
		);

Test script:
---------------
$tagMapArray = array(&quot;Foo&quot; =&gt; &quot;MyNameSpace\Classes\Foo&quot;, &quot;Bar&quot;=&gt;&quot;MyNameSpace\Classes\Bar&quot;);

$this-&gt;options_unserialize['tagMap'] = $tagMapArray;

$unserializer = new XML_Unserializer($this-&gt;options_unserialize);
$result_unserialize = $unserializer-&gt;unserialize($xmlResponse,false);



Expected result:
----------------
[Foo] =&gt; MyNameSpace\Classes\Foo Object
		(
			[Bar] =&gt; MyNameSpace\Classes\Bar Object
						(
							[Name] =&gt; &quot;ABC&quot;
						)
		)
		

Actual result:
--------------
[Foo]=&gt;
[MyNameSpace\Classes\Foo] =&gt; MyNameSpace\Classes\Foo Object
		(
	[Bar] =&gt;			
	[MyNameSpace\Classes\Bar] =&gt; MyNameSpace\Classes\Bar 
Object
						(
							[Name] =&gt; &quot;ABC&quot;
						)

				)

		)</pre>]]></description>
      <dc:date>2017-01-30T05:42:09+00:00</dc:date>
      <dc:creator>archana &amp;#x64;&amp;#111;&amp;#x74; mulye &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/21052">
      <title>XML_Serializer: Bug 21052 [Open] Incompatible Attributes Options</title>
      <link>http://pear.php.net/bugs/21052</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Bug
Reported by dicksonm
2016-04-12T09:59:42+00:00
PHP: Irrelevant OS:  Package Version: 0.20.2

Description:
------------
In Unserialize.php, when 'parseAttributes' is set as well as 'typeHints' the 
output data is corrupted by package's internal attributes.

Test script:
---------------
&lt;?php
$string = &lt;&lt;&lt;EOD
&lt;array _type=&quot;array&quot; Hello=&quot;world&quot; Glad=&quot;I am&quot;&gt;
&lt;XML_Serializer_Tag _originalKey=&quot;To see&quot; _type=&quot;string&quot;&gt;You&lt;/XML_Serializer_Tag&gt;
&lt;XML_Serializer_Tag _originalKey=&quot;I think&quot; _type=&quot;string&quot;&gt;We can be friends&lt;/XML_Serializer_Tag&gt;
&lt;/array&gt;
EOD;

require_once 'XML/Unserializer.php';
$engine = new XML_Unserializer();
$engine-&gt;setOption('parseAttributes', true);
$engine-&gt;setOption('typeHints', TRUE);
$engine-&gt;unserialize($string);
var_dump($engine-&gt;getUnserializedData());
?&gt;

Expected result:
----------------
array(4) {
  [&quot;Hello&quot;]=&gt;
  string(5) &quot;world&quot;
  [&quot;Glad&quot;]=&gt;
  string(4) &quot;I am&quot;
  [&quot;To see&quot;]=&gt;
  string(3) &quot;You&quot;
  [&quot;I think&quot;]=&gt;
  string(17) &quot;We can be friends&quot;
}


Actual result:
--------------
array(5) {
  [&quot;_type&quot;]=&gt;
  string(5) &quot;array&quot;
  [&quot;Hello&quot;]=&gt;
  string(5) &quot;world&quot;
  [&quot;Glad&quot;]=&gt;
  string(4) &quot;I am&quot;
  [0]=&gt;
  array(3) {
    [&quot;_originalKey&quot;]=&gt;
    string(6) &quot;To see&quot;
    [&quot;_type&quot;]=&gt;
    string(6) &quot;string&quot;
    [&quot;_content&quot;]=&gt;
    string(3) &quot;You&quot;
  }
  [1]=&gt;
  array(3) {
    [&quot;_originalKey&quot;]=&gt;
    string(7) &quot;I think&quot;
    [&quot;_type&quot;]=&gt;
    string(6) &quot;string&quot;
    [&quot;_content&quot;]=&gt;
    string(17) &quot;We can be friends&quot;
  }
}</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Bug
Reported by dicksonm
2016-04-12T09:59:42+00:00
PHP: Irrelevant OS:  Package Version: 0.20.2

Description:
------------
In Unserialize.php, when 'parseAttributes' is set as well as 'typeHints' the 
output data is corrupted by package's internal attributes.

Test script:
---------------
&lt;?php
$string = &lt;&lt;&lt;EOD
&lt;array _type=&quot;array&quot; Hello=&quot;world&quot; Glad=&quot;I am&quot;&gt;
&lt;XML_Serializer_Tag _originalKey=&quot;To see&quot; _type=&quot;string&quot;&gt;You&lt;/XML_Serializer_Tag&gt;
&lt;XML_Serializer_Tag _originalKey=&quot;I think&quot; _type=&quot;string&quot;&gt;We can be friends&lt;/XML_Serializer_Tag&gt;
&lt;/array&gt;
EOD;

require_once 'XML/Unserializer.php';
$engine = new XML_Unserializer();
$engine-&gt;setOption('parseAttributes', true);
$engine-&gt;setOption('typeHints', TRUE);
$engine-&gt;unserialize($string);
var_dump($engine-&gt;getUnserializedData());
?&gt;

Expected result:
----------------
array(4) {
  [&quot;Hello&quot;]=&gt;
  string(5) &quot;world&quot;
  [&quot;Glad&quot;]=&gt;
  string(4) &quot;I am&quot;
  [&quot;To see&quot;]=&gt;
  string(3) &quot;You&quot;
  [&quot;I think&quot;]=&gt;
  string(17) &quot;We can be friends&quot;
}


Actual result:
--------------
array(5) {
  [&quot;_type&quot;]=&gt;
  string(5) &quot;array&quot;
  [&quot;Hello&quot;]=&gt;
  string(5) &quot;world&quot;
  [&quot;Glad&quot;]=&gt;
  string(4) &quot;I am&quot;
  [0]=&gt;
  array(3) {
    [&quot;_originalKey&quot;]=&gt;
    string(6) &quot;To see&quot;
    [&quot;_type&quot;]=&gt;
    string(6) &quot;string&quot;
    [&quot;_content&quot;]=&gt;
    string(3) &quot;You&quot;
  }
  [1]=&gt;
  array(3) {
    [&quot;_originalKey&quot;]=&gt;
    string(7) &quot;I think&quot;
    [&quot;_type&quot;]=&gt;
    string(6) &quot;string&quot;
    [&quot;_content&quot;]=&gt;
    string(17) &quot;We can be friends&quot;
  }
}</pre>]]></description>
      <dc:date>2016-04-12T09:59:42+00:00</dc:date>
      <dc:creator>dickson &amp;#x64;&amp;#111;&amp;#x74; michael &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18652">
      <title>XML_Serializer: Feature/Change Request 18652 [Open] Option to change case of TAG</title>
      <link>http://pear.php.net/bugs/18652</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by saghemo
2011-07-05T22:12:23+00:00
PHP: 5.2.9 OS: RedHat Package Version: 0.20.2

Description:
------------
As XML is case sensitive, would be a great enhancement the option of normalize TAG names case.</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by saghemo
2011-07-05T22:12:23+00:00
PHP: 5.2.9 OS: RedHat Package Version: 0.20.2

Description:
------------
As XML is case sensitive, would be a great enhancement the option of normalize TAG names case.</pre>]]></description>
      <dc:date>2011-07-05T22:12:23+00:00</dc:date>
      <dc:creator>s &amp;#x64;&amp;#111;&amp;#x74; aghemo &amp;#x61;&amp;#116; adsoftware &amp;#x64;&amp;#111;&amp;#x74; it</dc:creator>
      <dc:subject>XML_Serializer Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18395">
      <title>XML_Serializer: Documentation Problem 18395 [Open] problem adding items with same name</title>
      <link>http://pear.php.net/bugs/18395</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Documentation Problem
Reported by nadeemshafi9
2011-03-24T17:35:28+00:00
PHP: 5.3.0 OS: centos Package Version: SVN

Description:
------------
hi guys

im using the pear xml serializer but i am running into a problem,

i have a framework for an API which i use to create an array and then output as xml with xml serializer.

The issue i have run into:

i define a default tag before i create an array

so my array is for example

array(
   &quot;a&quot;
   &quot;b&quot;
)

both of these will get labeled video in there xml
thats fine

&lt;video&gt;a&lt;/video&gt;
&lt;video&gt;b&lt;/video&gt;

ok so i have a whole bunch of &quot;videos&quot; with there _attributes set.


inside each video i need multiple media elements

&lt;media x=2&gt;x&lt;/media&gt;
&lt;media x=4&gt;x&lt;/media&gt;
&lt;media x=5&gt;x&lt;/media&gt;

my problem is that you cant add multiple items to an array with the same Key.

array(
   &quot;media&quot; =&gt; x,
   &quot;media&quot; =&gt; x,
   &quot;media&quot; =&gt; x
)

and if i let it default then the default tag is video


plus i cant set the _attributes of the tag unless i make the value of the key into an array eg.


array(
   &quot;media&quot; =&gt; array(&quot;_aributes&quot; =&gt; array(&quot;x&quot; =&gt; 1), &quot;mediaValue&quot; =&gt; &quot;x&quot;),
   &quot;media&quot; =&gt; array(&quot;_aributes&quot; =&gt; array(&quot;x&quot; =&gt; 2), &quot;mediaValue&quot; =&gt; &quot;x&quot;),
   &quot;media&quot; =&gt; array(&quot;_aributes&quot; =&gt; array(&quot;x&quot; =&gt; 2), &quot;mediaValue&quot; =&gt; &quot;x&quot;)
)


this will give me

&lt;media x=2&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;media x=4&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;media x=5&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;

at the moment i get

&lt;video&gt;
     &lt;media x=2&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;/video&gt;
&lt;video&gt;
    &lt;media x=4&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;/video&gt;
&lt;video&gt;
    &lt;media x=5&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;/video&gt;

i want to get

&lt;media x=2&gt;x&lt;/media&gt;
&lt;media x=4&gt;x&lt;/media&gt;
&lt;media x=5&gt;x&lt;/media&gt;


any help ? thanks im relay stuck on this one plus my API framework has constraints because it initializes the serializer at the end and inserts the array and parses outputs it


even an injection work around would be good but the serializer seems to convert all tags into html char codes
regards</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Documentation Problem
Reported by nadeemshafi9
2011-03-24T17:35:28+00:00
PHP: 5.3.0 OS: centos Package Version: SVN

Description:
------------
hi guys

im using the pear xml serializer but i am running into a problem,

i have a framework for an API which i use to create an array and then output as xml with xml serializer.

The issue i have run into:

i define a default tag before i create an array

so my array is for example

array(
   &quot;a&quot;
   &quot;b&quot;
)

both of these will get labeled video in there xml
thats fine

&lt;video&gt;a&lt;/video&gt;
&lt;video&gt;b&lt;/video&gt;

ok so i have a whole bunch of &quot;videos&quot; with there _attributes set.


inside each video i need multiple media elements

&lt;media x=2&gt;x&lt;/media&gt;
&lt;media x=4&gt;x&lt;/media&gt;
&lt;media x=5&gt;x&lt;/media&gt;

my problem is that you cant add multiple items to an array with the same Key.

array(
   &quot;media&quot; =&gt; x,
   &quot;media&quot; =&gt; x,
   &quot;media&quot; =&gt; x
)

and if i let it default then the default tag is video


plus i cant set the _attributes of the tag unless i make the value of the key into an array eg.


array(
   &quot;media&quot; =&gt; array(&quot;_aributes&quot; =&gt; array(&quot;x&quot; =&gt; 1), &quot;mediaValue&quot; =&gt; &quot;x&quot;),
   &quot;media&quot; =&gt; array(&quot;_aributes&quot; =&gt; array(&quot;x&quot; =&gt; 2), &quot;mediaValue&quot; =&gt; &quot;x&quot;),
   &quot;media&quot; =&gt; array(&quot;_aributes&quot; =&gt; array(&quot;x&quot; =&gt; 2), &quot;mediaValue&quot; =&gt; &quot;x&quot;)
)


this will give me

&lt;media x=2&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;media x=4&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;media x=5&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;

at the moment i get

&lt;video&gt;
     &lt;media x=2&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;/video&gt;
&lt;video&gt;
    &lt;media x=4&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;/video&gt;
&lt;video&gt;
    &lt;media x=5&gt;&lt;mediaValue&gt;x&lt;/mediaValue&gt;&lt;/media&gt;
&lt;/video&gt;

i want to get

&lt;media x=2&gt;x&lt;/media&gt;
&lt;media x=4&gt;x&lt;/media&gt;
&lt;media x=5&gt;x&lt;/media&gt;


any help ? thanks im relay stuck on this one plus my API framework has constraints because it initializes the serializer at the end and inserts the array and parses outputs it


even an injection work around would be good but the serializer seems to convert all tags into html char codes
regards</pre>]]></description>
      <dc:date>2011-03-24T17:35:28+00:00</dc:date>
      <dc:creator>nadeem &amp;#x64;&amp;#111;&amp;#x74; shafi &amp;#x61;&amp;#116; simplestream &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18359">
      <title>XML_Serializer: Bug 18359 [Open] Memory leak in between XML_UnSerializer &amp; XML_Parser</title>
      <link>http://pear.php.net/bugs/18359</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Bug
Reported by felixl
2011-03-11T22:50:41+00:00
PHP: 5.2.12 OS: WinXP Package Version: 0.20.2

Description:
------------
In XML_UnSerializer, you call setHandlerObj. This create a circular reference between xml_unserializer &amp; xml_parser. calling xml_unserializer in a loop create a memory leak because it's never freed. Unsetting _parser in XML_Unserializer before the loop fix the problem (or using setHandlerObj() too)

You should restructure the whole code with abstract function, so that we xml_parse call the function handler, the functions are re-defined in XML_Unserializer, so no need for the setHandler function at all. This will definitively fix the problem.

Also, maybe php 5.3, with is new garbage collector, can detect and still delete the object. I didn't test it.

To be sure that it works, use php &gt;= 5, and create a __destruct() function in XML_Unserializer with a print in it. This function should be called each loop.

Also, this problem also exist in XML_Serializer too and any other function that extends XML_Parser.

Test script:
---------------
&lt;?php
error_reporting(E_ALL); ini_set('display_errors', true);

$xml = &lt;&lt;&lt;EOT
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;TrackResponse&gt;&lt;Response&gt;&lt;TransactionReference&gt;&lt;/TransactionReference&gt;&lt;ResponseStatusCode&gt;1&lt;/ResponseStatusCode&gt;&lt;/Response&gt;&lt;/TrackResponse&gt;';
EOT;

require_once 'XML/UnSerializer.php';
$t =  null;
for ($i = 0; $i &lt; 1000; $i++) {
    print &quot;$i:&quot; . (string)memory_get_usage(true) . &quot;\n&quot;;
    $u = new XML_Unserializer();
    $a = $u-&gt;unserialize($xml);
    //$u-&gt;_parser-&gt;setHandlerObj($t);
    /**
     * IMPORTANT
     * If you don't unset the parser, you have a circular reference, 
     * so PHP will not destruct XML_Unserializer
     */
    //unset($u-&gt;_parser);
    unset($u, $a);
    sleep(1);
}

Expected result:
----------------
the memory between loop 0 and 1 should increase, but not afterward.

Actual result:
--------------
It increase, each 10-15 loops.

uncommenting the line 21 (unset($u-&gt;_parser);) fix the problem.</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Bug
Reported by felixl
2011-03-11T22:50:41+00:00
PHP: 5.2.12 OS: WinXP Package Version: 0.20.2

Description:
------------
In XML_UnSerializer, you call setHandlerObj. This create a circular reference between xml_unserializer &amp; xml_parser. calling xml_unserializer in a loop create a memory leak because it's never freed. Unsetting _parser in XML_Unserializer before the loop fix the problem (or using setHandlerObj() too)

You should restructure the whole code with abstract function, so that we xml_parse call the function handler, the functions are re-defined in XML_Unserializer, so no need for the setHandler function at all. This will definitively fix the problem.

Also, maybe php 5.3, with is new garbage collector, can detect and still delete the object. I didn't test it.

To be sure that it works, use php &gt;= 5, and create a __destruct() function in XML_Unserializer with a print in it. This function should be called each loop.

Also, this problem also exist in XML_Serializer too and any other function that extends XML_Parser.

Test script:
---------------
&lt;?php
error_reporting(E_ALL); ini_set('display_errors', true);

$xml = &lt;&lt;&lt;EOT
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;TrackResponse&gt;&lt;Response&gt;&lt;TransactionReference&gt;&lt;/TransactionReference&gt;&lt;ResponseStatusCode&gt;1&lt;/ResponseStatusCode&gt;&lt;/Response&gt;&lt;/TrackResponse&gt;';
EOT;

require_once 'XML/UnSerializer.php';
$t =  null;
for ($i = 0; $i &lt; 1000; $i++) {
    print &quot;$i:&quot; . (string)memory_get_usage(true) . &quot;\n&quot;;
    $u = new XML_Unserializer();
    $a = $u-&gt;unserialize($xml);
    //$u-&gt;_parser-&gt;setHandlerObj($t);
    /**
     * IMPORTANT
     * If you don't unset the parser, you have a circular reference, 
     * so PHP will not destruct XML_Unserializer
     */
    //unset($u-&gt;_parser);
    unset($u, $a);
    sleep(1);
}

Expected result:
----------------
the memory between loop 0 and 1 should increase, but not afterward.

Actual result:
--------------
It increase, each 10-15 loops.

uncommenting the line 21 (unset($u-&gt;_parser);) fix the problem.</pre>]]></description>
      <dc:date>2011-03-11T22:50:41+00:00</dc:date>
      <dc:creator>felixl &amp;#x61;&amp;#116; densi &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17636">
      <title>XML_Serializer: Bug 17636 [Open] Can't parse accentuated tagnames</title>
      <link>http://pear.php.net/bugs/17636</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Bug
Reported by tamicsko
2010-07-28T19:14:31+00:00
PHP: 5.2.6 OS: windows xp sp3 Package Version: Unknown

Description:
------------
Accentuated tagnames are replaced as XML_Serializer_Tag in serialize(). The php file itself is UTF-8 encoded 

Test script:
---------------
$xx = new XML_Serializer( 
	array(
		XML_SERIALIZER_OPTION_INDENT =&gt; &quot;\t&quot;, 
		XML_SERIALIZER_OPTION_LINEBREAKS =&gt; &quot;\n&quot;, 
		XML_SERIALIZER_OPTION_ROOT_NAME =&gt; 'xml', 
		XML_SERIALIZER_OPTION_MODE =&gt; XML_SERIALIZER_MODE_SIMPLEXML, 
		XML_SERIALIZER_OPTION_CDATA_SECTIONS =&gt; true, 
		XML_SERIALIZER_OPTION_XML_ENCODING =&gt; 'UTF-8'
	)
);

$data = array(
	&quot;tag_1&quot; =&gt; &quot;value_1&quot;,
	&quot;tag_2&quot; =&gt; array(
					&quot;tag_Ã¡_3&quot; =&gt; &quot;value_Ã©&quot;
				),
	&quot;tag_Ã©_4&quot; =&gt; array(
					&quot;tag_5&quot; =&gt; &quot;value_5&quot;
				)
);

$xx-&gt;serialize( $data);
$xml_data = $xx-&gt;getSerializedData();
	
print_r( $xml_data);	


Expected result:
----------------
&lt;xml&gt;
	&lt;tag_1&gt;&lt;![CDATA[value_1]]&gt;&lt;/tag_1&gt;
	&lt;tag_2&gt;
		&lt;tag_Ã¡_3&gt;&lt;![CDATA[value_Ã©]]&gt;&lt;/tag_Ã¡_3&gt;
	&lt;/tag_2&gt;
	&lt;tag_Ã©_4&gt;
		&lt;tag_5&gt;&lt;![CDATA[value_5]]&gt;&lt;/tag_5&gt;
	&lt;/tag_Ã©_4&gt;
&lt;/xml&gt;


Actual result:
--------------
&lt;xml&gt;
	&lt;tag_1&gt;&lt;![CDATA[value_1]]&gt;&lt;/tag_1&gt;
	&lt;tag_2&gt;
		&lt;XML_Serializer_Tag&gt;&lt;![CDATA[value_Ã©]]&gt;&lt;/XML_Serializer_Tag&gt;
	&lt;/tag_2&gt;
	&lt;XML_Serializer_Tag&gt;
		&lt;tag_5&gt;&lt;![CDATA[value_5]]&gt;&lt;/tag_5&gt;
	&lt;/XML_Serializer_Tag&gt;
&lt;/xml&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Bug
Reported by tamicsko
2010-07-28T19:14:31+00:00
PHP: 5.2.6 OS: windows xp sp3 Package Version: Unknown

Description:
------------
Accentuated tagnames are replaced as XML_Serializer_Tag in serialize(). The php file itself is UTF-8 encoded 

Test script:
---------------
$xx = new XML_Serializer( 
	array(
		XML_SERIALIZER_OPTION_INDENT =&gt; &quot;\t&quot;, 
		XML_SERIALIZER_OPTION_LINEBREAKS =&gt; &quot;\n&quot;, 
		XML_SERIALIZER_OPTION_ROOT_NAME =&gt; 'xml', 
		XML_SERIALIZER_OPTION_MODE =&gt; XML_SERIALIZER_MODE_SIMPLEXML, 
		XML_SERIALIZER_OPTION_CDATA_SECTIONS =&gt; true, 
		XML_SERIALIZER_OPTION_XML_ENCODING =&gt; 'UTF-8'
	)
);

$data = array(
	&quot;tag_1&quot; =&gt; &quot;value_1&quot;,
	&quot;tag_2&quot; =&gt; array(
					&quot;tag_Ã¡_3&quot; =&gt; &quot;value_Ã©&quot;
				),
	&quot;tag_Ã©_4&quot; =&gt; array(
					&quot;tag_5&quot; =&gt; &quot;value_5&quot;
				)
);

$xx-&gt;serialize( $data);
$xml_data = $xx-&gt;getSerializedData();
	
print_r( $xml_data);	


Expected result:
----------------
&lt;xml&gt;
	&lt;tag_1&gt;&lt;![CDATA[value_1]]&gt;&lt;/tag_1&gt;
	&lt;tag_2&gt;
		&lt;tag_Ã¡_3&gt;&lt;![CDATA[value_Ã©]]&gt;&lt;/tag_Ã¡_3&gt;
	&lt;/tag_2&gt;
	&lt;tag_Ã©_4&gt;
		&lt;tag_5&gt;&lt;![CDATA[value_5]]&gt;&lt;/tag_5&gt;
	&lt;/tag_Ã©_4&gt;
&lt;/xml&gt;


Actual result:
--------------
&lt;xml&gt;
	&lt;tag_1&gt;&lt;![CDATA[value_1]]&gt;&lt;/tag_1&gt;
	&lt;tag_2&gt;
		&lt;XML_Serializer_Tag&gt;&lt;![CDATA[value_Ã©]]&gt;&lt;/XML_Serializer_Tag&gt;
	&lt;/tag_2&gt;
	&lt;XML_Serializer_Tag&gt;
		&lt;tag_5&gt;&lt;![CDATA[value_5]]&gt;&lt;/tag_5&gt;
	&lt;/XML_Serializer_Tag&gt;
&lt;/xml&gt;</pre>]]></description>
      <dc:date>2010-07-28T19:14:31+00:00</dc:date>
      <dc:creator>benno &amp;#x64;&amp;#111;&amp;#x74; tamas &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17577">
      <title>XML_Serializer: Bug 17577 [Open] Array index being used as tag name rather than object name</title>
      <link>http://pear.php.net/bugs/17577</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Bug
Reported by markcorbyn
2010-07-10T14:01:44+00:00
PHP: 5.2.9 OS: Windows 7 Package Version: 0.20.0

Description:
------------
When serialising an array containing multiple Country objects, the first xml node inside the root is the Country tag, but all the others are invalid numerical tags e.g. &lt;1&gt;...&lt;/1&gt;&lt;2&gt;...&lt;/2&gt;

I've tracked down to a solution which currently works for me, but there may be undesired side-effects I'm unaware of.  Line 1129 of Serializer.php  checks for if(empty($tagName)).  In the case of the first Country array value, the $tagName = 0 which eveluates to empty(), whereas the others don't evaluate to empty(), making the first one refer to the get_class($object) whereas subsequence array values just use the $tagName.

Sample print_r() of the array being privided to serializer:

Array
(
    [0] =&gt; Country Object
        (
            [CountryCode] =&gt; AD
            [CountryName] =&gt; ANDORRA
            [RegionID] =&gt; 2
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

    [1] =&gt; Country Object
        (
            [CountryCode] =&gt; AE
            [CountryName] =&gt; UNITED ARAB EMIRATES
            [RegionID] =&gt; 8
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

    [2] =&gt; Country Object
        (
            [CountryCode] =&gt; AF
            [CountryName] =&gt; AFGHANISTAN
            [RegionID] =&gt; 8
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

    [3] =&gt; Country Object
        (
            [CountryCode] =&gt; AG
            [CountryName] =&gt; ANTIGUA AND BARBUDA
            [RegionID] =&gt; 3
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

    [4] =&gt; Country Object
        (
            [CountryCode] =&gt; AI
            [CountryName] =&gt; ANGUILLA
            [RegionID] =&gt; 3
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

)



Sample  result:
&lt;array&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AD&lt;/CountryCode&gt;
&lt;CountryName&gt;ANDORRA&lt;/CountryName&gt;
&lt;RegionID&gt;2&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;1&gt;
&lt;CountryCode&gt;AE&lt;/CountryCode&gt;
&lt;CountryName&gt;UNITED ARAB EMIRATES&lt;/CountryName&gt;

&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/1&gt;
&lt;2&gt;
&lt;CountryCode&gt;AF&lt;/CountryCode&gt;
&lt;CountryName&gt;AFGHANISTAN&lt;/CountryName&gt;
&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/2&gt;

&lt;3&gt;
&lt;CountryCode&gt;AG&lt;/CountryCode&gt;
&lt;CountryName&gt;ANTIGUA AND BARBUDA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/3&gt;
&lt;4&gt;
&lt;CountryCode&gt;AI&lt;/CountryCode&gt;
&lt;CountryName&gt;ANGUILLA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;

&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/4&gt;
&lt;/array&gt;

Solution aqpplied, change line 1129 from:

if (empty($tagName)) {

to

if (empty($tagName) || is_numeric($tagName)) {




Expected result:
----------------
&lt;array&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AD&lt;/CountryCode&gt;
&lt;CountryName&gt;ANDORRA&lt;/CountryName&gt;
&lt;RegionID&gt;2&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AE&lt;/CountryCode&gt;
&lt;CountryName&gt;UNITED ARAB EMIRATES&lt;/CountryName&gt;

&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AF&lt;/CountryCode&gt;
&lt;CountryName&gt;AFGHANISTAN&lt;/CountryName&gt;
&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;

&lt;Country&gt;
&lt;CountryCode&gt;AG&lt;/CountryCode&gt;
&lt;CountryName&gt;ANTIGUA AND BARBUDA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AI&lt;/CountryCode&gt;
&lt;CountryName&gt;ANGUILLA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;

&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;/array&gt;

Actual result:
--------------
&lt;array&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AD&lt;/CountryCode&gt;
&lt;CountryName&gt;ANDORRA&lt;/CountryName&gt;
&lt;RegionID&gt;2&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;1&gt;
&lt;CountryCode&gt;AE&lt;/CountryCode&gt;
&lt;CountryName&gt;UNITED ARAB EMIRATES&lt;/CountryName&gt;

&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/1&gt;
&lt;2&gt;
&lt;CountryCode&gt;AF&lt;/CountryCode&gt;
&lt;CountryName&gt;AFGHANISTAN&lt;/CountryName&gt;
&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/2&gt;

&lt;3&gt;
&lt;CountryCode&gt;AG&lt;/CountryCode&gt;
&lt;CountryName&gt;ANTIGUA AND BARBUDA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/3&gt;
&lt;4&gt;
&lt;CountryCode&gt;AI&lt;/CountryCode&gt;
&lt;CountryName&gt;ANGUILLA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;

&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/4&gt;
&lt;/array&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Bug
Reported by markcorbyn
2010-07-10T14:01:44+00:00
PHP: 5.2.9 OS: Windows 7 Package Version: 0.20.0

Description:
------------
When serialising an array containing multiple Country objects, the first xml node inside the root is the Country tag, but all the others are invalid numerical tags e.g. &lt;1&gt;...&lt;/1&gt;&lt;2&gt;...&lt;/2&gt;

I've tracked down to a solution which currently works for me, but there may be undesired side-effects I'm unaware of.  Line 1129 of Serializer.php  checks for if(empty($tagName)).  In the case of the first Country array value, the $tagName = 0 which eveluates to empty(), whereas the others don't evaluate to empty(), making the first one refer to the get_class($object) whereas subsequence array values just use the $tagName.

Sample print_r() of the array being privided to serializer:

Array
(
    [0] =&gt; Country Object
        (
            [CountryCode] =&gt; AD
            [CountryName] =&gt; ANDORRA
            [RegionID] =&gt; 2
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

    [1] =&gt; Country Object
        (
            [CountryCode] =&gt; AE
            [CountryName] =&gt; UNITED ARAB EMIRATES
            [RegionID] =&gt; 8
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

    [2] =&gt; Country Object
        (
            [CountryCode] =&gt; AF
            [CountryName] =&gt; AFGHANISTAN
            [RegionID] =&gt; 8
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

    [3] =&gt; Country Object
        (
            [CountryCode] =&gt; AG
            [CountryName] =&gt; ANTIGUA AND BARBUDA
            [RegionID] =&gt; 3
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

    [4] =&gt; Country Object
        (
            [CountryCode] =&gt; AI
            [CountryName] =&gt; ANGUILLA
            [RegionID] =&gt; 3
            [VisaRequired] =&gt; 
            [VisaApprovalWeeks] =&gt; 
            [VisaCompletionDeadlineWeeks] =&gt; 
        )

)



Sample  result:
&lt;array&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AD&lt;/CountryCode&gt;
&lt;CountryName&gt;ANDORRA&lt;/CountryName&gt;
&lt;RegionID&gt;2&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;1&gt;
&lt;CountryCode&gt;AE&lt;/CountryCode&gt;
&lt;CountryName&gt;UNITED ARAB EMIRATES&lt;/CountryName&gt;

&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/1&gt;
&lt;2&gt;
&lt;CountryCode&gt;AF&lt;/CountryCode&gt;
&lt;CountryName&gt;AFGHANISTAN&lt;/CountryName&gt;
&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/2&gt;

&lt;3&gt;
&lt;CountryCode&gt;AG&lt;/CountryCode&gt;
&lt;CountryName&gt;ANTIGUA AND BARBUDA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/3&gt;
&lt;4&gt;
&lt;CountryCode&gt;AI&lt;/CountryCode&gt;
&lt;CountryName&gt;ANGUILLA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;

&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/4&gt;
&lt;/array&gt;

Solution aqpplied, change line 1129 from:

if (empty($tagName)) {

to

if (empty($tagName) || is_numeric($tagName)) {




Expected result:
----------------
&lt;array&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AD&lt;/CountryCode&gt;
&lt;CountryName&gt;ANDORRA&lt;/CountryName&gt;
&lt;RegionID&gt;2&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AE&lt;/CountryCode&gt;
&lt;CountryName&gt;UNITED ARAB EMIRATES&lt;/CountryName&gt;

&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AF&lt;/CountryCode&gt;
&lt;CountryName&gt;AFGHANISTAN&lt;/CountryName&gt;
&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;

&lt;Country&gt;
&lt;CountryCode&gt;AG&lt;/CountryCode&gt;
&lt;CountryName&gt;ANTIGUA AND BARBUDA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AI&lt;/CountryCode&gt;
&lt;CountryName&gt;ANGUILLA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;

&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;/array&gt;

Actual result:
--------------
&lt;array&gt;
&lt;Country&gt;
&lt;CountryCode&gt;AD&lt;/CountryCode&gt;
&lt;CountryName&gt;ANDORRA&lt;/CountryName&gt;
&lt;RegionID&gt;2&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/Country&gt;
&lt;1&gt;
&lt;CountryCode&gt;AE&lt;/CountryCode&gt;
&lt;CountryName&gt;UNITED ARAB EMIRATES&lt;/CountryName&gt;

&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/1&gt;
&lt;2&gt;
&lt;CountryCode&gt;AF&lt;/CountryCode&gt;
&lt;CountryName&gt;AFGHANISTAN&lt;/CountryName&gt;
&lt;RegionID&gt;8&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/2&gt;

&lt;3&gt;
&lt;CountryCode&gt;AG&lt;/CountryCode&gt;
&lt;CountryName&gt;ANTIGUA AND BARBUDA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;
&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/3&gt;
&lt;4&gt;
&lt;CountryCode&gt;AI&lt;/CountryCode&gt;
&lt;CountryName&gt;ANGUILLA&lt;/CountryName&gt;
&lt;RegionID&gt;3&lt;/RegionID&gt;

&lt;VisaRequired /&gt;
&lt;VisaApprovalWeeks /&gt;
&lt;VisaCompletionDeadlineWeeks /&gt;
&lt;/4&gt;
&lt;/array&gt;</pre>]]></description>
      <dc:date>2010-07-10T14:01:44+00:00</dc:date>
      <dc:creator>markcorbyn &amp;#x61;&amp;#116; hotmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17281">
      <title>XML_Serializer: Documentation Problem 17281 [Open] No idea in the docs of what the option 'addDecl' does</title>
      <link>http://pear.php.net/bugs/17281</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Documentation Problem
Reported by kguest
2010-03-30T20:55:46+00:00
PHP: 5.2.6 OS:  Package Version: 0.20.0

Description:
------------
No idea in the docs of what the option 'addDecl' does...this needs to be documented. 

http://stackoverflow.com/questions/2534772/what-does-the-adddecl-option-do-in-pear-xml-serialize/</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Documentation Problem
Reported by kguest
2010-03-30T20:55:46+00:00
PHP: 5.2.6 OS:  Package Version: 0.20.0

Description:
------------
No idea in the docs of what the option 'addDecl' does...this needs to be documented. 

http://stackoverflow.com/questions/2534772/what-does-the-adddecl-option-do-in-pear-xml-serialize/</pre>]]></description>
      <dc:date>2010-03-30T20:55:46+00:00</dc:date>
      <dc:creator>ken &amp;#x61;&amp;#116; linux &amp;#x64;&amp;#111;&amp;#x74; ie</dc:creator>
      <dc:subject>XML_Serializer Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16979">
      <title>XML_Serializer: Feature/Change Request 16979 [Open] Add option to make a field use CDATA</title>
      <link>http://pear.php.net/bugs/16979</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by jcotaker
2010-01-08T05:21:16+00:00
PHP: 5.2.5 OS:  Package Version: 0.20.0

Description:
------------
Add the option to use CDATA in specific nodes. Sometimes we 
need to use something like &lt;key&gt;&lt;![CDATA[this is a link 
&lt;b&gt;name&lt;/b&gt;more text]]&gt;&lt;/key&gt;. The way you make sure to 
run htmlentities on the xml string is great, but sometimes we 
need it not to do it.</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by jcotaker
2010-01-08T05:21:16+00:00
PHP: 5.2.5 OS:  Package Version: 0.20.0

Description:
------------
Add the option to use CDATA in specific nodes. Sometimes we 
need to use something like &lt;key&gt;&lt;![CDATA[this is a link 
&lt;b&gt;name&lt;/b&gt;more text]]&gt;&lt;/key&gt;. The way you make sure to 
run htmlentities on the xml string is great, but sometimes we 
need it not to do it.</pre>]]></description>
      <dc:date>2010-01-08T05:21:16+00:00</dc:date>
      <dc:creator>jcotaker &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16618">
      <title>XML_Serializer: Bug 16618 [Open] Fench chars are scrambled after Unserialize</title>
      <link>http://pear.php.net/bugs/16618</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Bug
Reported by galiganu
2009-09-16T20:30:57+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 0.20.0

Description:
------------
Hi

I have exported data from a database in a xml file. Data contains also french text.
After Unserialize, accent chars are scrambled.

Test script:
---------------
$unserializer = &amp;new XML_UNserializer(array('complexType' =&gt; 'array',
                                                              'parseAttributes' =&gt; true,
                                                              'whitespace' =&gt; XML_UNSERIALIZER_WHITESPACE_KEEP,
                                                              'guessTypes' =&gt; false));

$result = $unserializer-&gt;unserialize($xml_file, true);

if ($result === true)
{
    echo $this-&gt;unserializer-&gt;getUnserializedData();
}

$xml_file contains:
-------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;
&lt;items&gt;
    &lt;item&gt;TÃ©lÃ©phonie rÃ©sidentielle&lt;/item&gt;
&lt;/items&gt;



Expected result:
----------------
TÃ©lÃ©phonie rÃ©sidentielle

Actual result:
--------------
TÃÂ©lÃÂ©phonie rÃÂ©sidentielle</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Bug
Reported by galiganu
2009-09-16T20:30:57+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 0.20.0

Description:
------------
Hi

I have exported data from a database in a xml file. Data contains also french text.
After Unserialize, accent chars are scrambled.

Test script:
---------------
$unserializer = &amp;new XML_UNserializer(array('complexType' =&gt; 'array',
                                                              'parseAttributes' =&gt; true,
                                                              'whitespace' =&gt; XML_UNSERIALIZER_WHITESPACE_KEEP,
                                                              'guessTypes' =&gt; false));

$result = $unserializer-&gt;unserialize($xml_file, true);

if ($result === true)
{
    echo $this-&gt;unserializer-&gt;getUnserializedData();
}

$xml_file contains:
-------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;
&lt;items&gt;
    &lt;item&gt;TÃ©lÃ©phonie rÃ©sidentielle&lt;/item&gt;
&lt;/items&gt;



Expected result:
----------------
TÃ©lÃ©phonie rÃ©sidentielle

Actual result:
--------------
TÃÂ©lÃÂ©phonie rÃÂ©sidentielle</pre>]]></description>
      <dc:date>2009-09-16T20:30:57+00:00</dc:date>
      <dc:creator>ionut &amp;#x64;&amp;#111;&amp;#x74; aivanesei &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16588">
      <title>XML_Serializer: Feature/Change Request 16588 [Open] XSD schema support</title>
      <link>http://pear.php.net/bugs/16588</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by moiseev
2009-09-10T15:09:17+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 0.20.0

Description:
------------
I'd like to request the XSD schema support by the XML_Serializer class.
It is frequently needed to validate the xml versus the corresponding scheme!

Is there any plans to implement it?

PS. The only one workaround I found. It is to use DOMDocument class via the method schemaValidate, but it would be great to have it with one instance of Serilizer! 
See the link: http://us3.php.net/manual/en/class.domdocument.php</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by moiseev
2009-09-10T15:09:17+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 0.20.0

Description:
------------
I'd like to request the XSD schema support by the XML_Serializer class.
It is frequently needed to validate the xml versus the corresponding scheme!

Is there any plans to implement it?

PS. The only one workaround I found. It is to use DOMDocument class via the method schemaValidate, but it would be great to have it with one instance of Serilizer! 
See the link: http://us3.php.net/manual/en/class.domdocument.php</pre>]]></description>
      <dc:date>2009-09-10T15:09:17+00:00</dc:date>
      <dc:creator>moiseev &amp;#x64;&amp;#111;&amp;#x74; igor &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16402">
      <title>XML_Serializer: Feature/Change Request 16402 [Open] Add 'standalone' attribute in &lt;?xml&gt;</title>
      <link>http://pear.php.net/bugs/16402</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by ts
2009-07-03T18:37:23+00:00
PHP: 5.2.5 OS: Linux Package Version: 0.20.0

Description:
------------
It's currently not possible to define the 'standalone' attribute in the &lt;?xml&gt; declaration.

In other words, it's impossible to construct the following:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by ts
2009-07-03T18:37:23+00:00
PHP: 5.2.5 OS: Linux Package Version: 0.20.0

Description:
------------
It's currently not possible to define the 'standalone' attribute in the &lt;?xml&gt; declaration.

In other words, it's impossible to construct the following:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;</pre>]]></description>
      <dc:date>2009-07-03T18:37:23+00:00</dc:date>
      <dc:creator>mail &amp;#x61;&amp;#116; tomsommer &amp;#x64;&amp;#111;&amp;#x74; dk</dc:creator>
      <dc:subject>XML_Serializer Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16204">
      <title>XML_Serializer: Bug 16204 [Open] Inconsistent data when FORCE_ENUM is on</title>
      <link>http://pear.php.net/bugs/16204</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Bug
Reported by ifeghali
2009-05-08T04:09:19+00:00
PHP: 5.1.6 OS: CentOS 5.3 Package Version: 0.19.2

Description:
------------
When force enum is on, if one serialize an empty array and unserialize it back one will end up with an array with a single empty element.

Test script:
---------------
&lt;?php

require_once 'PEAR.php';
require_once 'XML/Serializer.php';
require_once 'XML/Unserializer.php';

$xml = 'test.xml';

/* SERIALIZE */
$options = array(
    XML_SERIALIZER_OPTION_MODE          =&gt; 'simplexml',
    XML_SERIALIZER_OPTION_ROOT_NAME     =&gt; 'foo',
    XML_SERIALIZER_OPTION_RETURN_RESULT =&gt; true,
);
$serializer =&amp; new XML_Serializer($options);
$data = array('bar' =&gt; array());
$result = $serializer-&gt;serialize($data);
$fxml = @fopen(&quot;$xml&quot;, 'w');
fwrite($fxml, $result);

/* UNSERIALIZE */
$options = array(
    XML_UNSERIALIZER_OPTION_FORCE_ENUM =&gt; array('bar'),
);
$unserializer =&amp; new XML_Unserializer($options);
$result = $unserializer-&gt;unserialize($xml, true);
$result = $unserializer-&gt;getUnserializedData();
print_r($result);

?&gt;

Expected result:
----------------
Array
(
    [bar] =&gt; Array
        (
        )

)

Actual result:
--------------
Array
(
    [bar] =&gt; Array
        (
            [0] =&gt;
        )

)</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Bug
Reported by ifeghali
2009-05-08T04:09:19+00:00
PHP: 5.1.6 OS: CentOS 5.3 Package Version: 0.19.2

Description:
------------
When force enum is on, if one serialize an empty array and unserialize it back one will end up with an array with a single empty element.

Test script:
---------------
&lt;?php

require_once 'PEAR.php';
require_once 'XML/Serializer.php';
require_once 'XML/Unserializer.php';

$xml = 'test.xml';

/* SERIALIZE */
$options = array(
    XML_SERIALIZER_OPTION_MODE          =&gt; 'simplexml',
    XML_SERIALIZER_OPTION_ROOT_NAME     =&gt; 'foo',
    XML_SERIALIZER_OPTION_RETURN_RESULT =&gt; true,
);
$serializer =&amp; new XML_Serializer($options);
$data = array('bar' =&gt; array());
$result = $serializer-&gt;serialize($data);
$fxml = @fopen(&quot;$xml&quot;, 'w');
fwrite($fxml, $result);

/* UNSERIALIZE */
$options = array(
    XML_UNSERIALIZER_OPTION_FORCE_ENUM =&gt; array('bar'),
);
$unserializer =&amp; new XML_Unserializer($options);
$result = $unserializer-&gt;unserialize($xml, true);
$result = $unserializer-&gt;getUnserializedData();
print_r($result);

?&gt;

Expected result:
----------------
Array
(
    [bar] =&gt; Array
        (
        )

)

Actual result:
--------------
Array
(
    [bar] =&gt; Array
        (
            [0] =&gt;
        )

)</pre>]]></description>
      <dc:date>2009-05-08T04:09:19+00:00</dc:date>
      <dc:creator>ifeghali &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>XML_Serializer Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16153">
      <title>XML_Serializer: Bug 16153 [Open] XML Entities are removed entirely</title>
      <link>http://pear.php.net/bugs/16153</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Bug
Reported by galiganu
2009-04-27T07:29:58+00:00
PHP: Irrelevant OS: SunOS Package Version: 0.19.2

Description:
------------
I have the a xml file (test.xml) containing following:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;applications&gt;
    &lt;application&gt;
        &lt;id&gt;1&lt;/id&gt;
        &lt;application_name&gt;A&amp;B&lt;/application_name&gt;
    &lt;/application&gt;
&lt;/applications&gt;

When trying to unserialize it the '&amp;' is removed from the string (entirely).

Please note that everything goes OK on my Windows PC (with same package and php version). Only on the solaris server I have this issue.

Test script:
---------------
&lt;?php

$options = array( 'complexType' =&gt; 'array',
                  'parseAttributes' =&gt; false,
                  'whitespace' =&gt; XML_UNSERIALIZER_WHITESPACE_TRIM,
                  'guessTypes' =&gt; false);

$unserializer = &amp;new XML_UNserializer($options);
$result = $unserializer-&gt;unserialize('test.xml', true);

if ($result === true)
{
    $data = $unserializer-&gt;getUnserializedData();
}

?&gt;

Expected result:
----------------
Array
(
    [application] =&gt; Array
        (
            [id] =&gt; 1
            [application_name] =&gt; A&amp;B
        )

)


Actual result:
--------------
Array
(
    [application] =&gt; Array
        (
            [id] =&gt; 1
            [application_name] =&gt; AB
        )

)</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Bug
Reported by galiganu
2009-04-27T07:29:58+00:00
PHP: Irrelevant OS: SunOS Package Version: 0.19.2

Description:
------------
I have the a xml file (test.xml) containing following:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;applications&gt;
    &lt;application&gt;
        &lt;id&gt;1&lt;/id&gt;
        &lt;application_name&gt;A&amp;B&lt;/application_name&gt;
    &lt;/application&gt;
&lt;/applications&gt;

When trying to unserialize it the '&amp;' is removed from the string (entirely).

Please note that everything goes OK on my Windows PC (with same package and php version). Only on the solaris server I have this issue.

Test script:
---------------
&lt;?php

$options = array( 'complexType' =&gt; 'array',
                  'parseAttributes' =&gt; false,
                  'whitespace' =&gt; XML_UNSERIALIZER_WHITESPACE_TRIM,
                  'guessTypes' =&gt; false);

$unserializer = &amp;new XML_UNserializer($options);
$result = $unserializer-&gt;unserialize('test.xml', true);

if ($result === true)
{
    $data = $unserializer-&gt;getUnserializedData();
}

?&gt;

Expected result:
----------------
Array
(
    [application] =&gt; Array
        (
            [id] =&gt; 1
            [application_name] =&gt; A&amp;B
        )

)


Actual result:
--------------
Array
(
    [application] =&gt; Array
        (
            [id] =&gt; 1
            [application_name] =&gt; AB
        )

)</pre>]]></description>
      <dc:date>2009-05-23T23:12:54+00:00</dc:date>
      <dc:creator>ionut &amp;#x64;&amp;#111;&amp;#x74; aivanesei &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>XML_Serializer Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15670">
      <title>XML_Serializer: Feature/Change Request 15670 [Open] Line Numbers</title>
      <link>http://pear.php.net/bugs/15670</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by ifeghali
2009-01-18T10:37:32+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
Since XML_Unserializer replaced XML_Tree it would be handy to have line numbers data available to the user as in the later.</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by ifeghali
2009-01-18T10:37:32+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
Since XML_Unserializer replaced XML_Tree it would be handy to have line numbers data available to the user as in the later.</pre>]]></description>
      <dc:date>2009-01-18T10:37:32+00:00</dc:date>
      <dc:creator>ifeghali &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>XML_Serializer Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14112">
      <title>XML_Serializer: Feature/Change Request 14112 [Analyzed] #default is ignored for scalarAsAttributes</title>
      <link>http://pear.php.net/bugs/14112</link>
      <content:encoded><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by protricity
2008-06-09T20:06:26+00:00
PHP: 5.2.6 OS: Windows Package Version: 0.18.0

Description:
------------
#default is ignored for scalarAsAttributes on line 764 for Serializer.php. Documentation says #default is considered whenever an array is given for tags.

Heres a patch:

        $scalarAsAttributes = false;
        if (is_array($this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES])) {
            $scalarAsAttributes =  isset($this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES][$tagName])?
									$this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES][$tagName]:
									$this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES]['#default'];
									
        } elseif ($this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES] === true) {
            $scalarAsAttributes = true;
        }

Test script:
---------------
$serializer = &amp;new XML_Serializer(array(
						XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES =&gt; array('#default'=&gt;true,'tag3'=&gt;false),
	));
echo serializer-&gt;serialize(array('tag'=&gt;array('tag2'=&gt;2,'tag3'=&gt;'hi')));

Expected result:
----------------
#default is ignored.

Actual result:
--------------
#default is used to all missing tags.</pre>]]></content:encoded>
      <description><![CDATA[<pre>XML_Serializer Feature/Change Request
Reported by protricity
2008-06-09T20:06:26+00:00
PHP: 5.2.6 OS: Windows Package Version: 0.18.0

Description:
------------
#default is ignored for scalarAsAttributes on line 764 for Serializer.php. Documentation says #default is considered whenever an array is given for tags.

Heres a patch:

        $scalarAsAttributes = false;
        if (is_array($this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES])) {
            $scalarAsAttributes =  isset($this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES][$tagName])?
									$this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES][$tagName]:
									$this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES]['#default'];
									
        } elseif ($this-&gt;options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES] === true) {
            $scalarAsAttributes = true;
        }

Test script:
---------------
$serializer = &amp;new XML_Serializer(array(
						XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES =&gt; array('#default'=&gt;true,'tag3'=&gt;false),
	));
echo serializer-&gt;serialize(array('tag'=&gt;array('tag2'=&gt;2,'tag3'=&gt;'hi')));

Expected result:
----------------
#default is ignored.

Actual result:
--------------
#default is used to all missing tags.</pre>]]></description>
      <dc:date>2009-06-12T08:15:59+00:00</dc:date>
      <dc:creator>ari &amp;#x61;&amp;#116; songportal &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>XML_Serializer Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
