Home » XML » XML_Serializer » Bug #9799
attributesArray is poorly named
Details
| Submitted | 2007-01-10 23:24 UTC |
|---|---|
| From | ljou1 at yahoo dot com |
| Assigned | ashnazg |
| Status | Bogus |
| Package | XML_Serializer |
| PHP Version | 5.1.2 |
| OS | windows xp |
| Roadmaps | (Not assigned) |
Comments
[2007-01-10 23:24 UTC] ljou1 at yahoo dot com
Description:
------------
When attributesArray is set to an arry, it cuases php to generate warning.
Warning: Illegal offset type in isset or empty in C:\oscommerce\xampp\php\pear\X
ML\Serializer.php on line 713
Test script:
---------------
<?php
require_once 'XML/Serializer.php';
$color = array('f'=>array(array('id'=>'blue','-'=>'red'),array('id'=>'qqq','-'=>'green')));
$options = array(
'addDecl' => true,
'rootName'=>'truecolor',
'indent'=>' ',
'mode'=>'simplexml',
'scalarAsAttributes'=>array('f'=>array('id')),
'attributesArray'=>array('-'),
'contentName'=>'-'
);
$s = new XML_Serializer($options);
$status = $s->serialize($color);
echo $s->getSerializedData();
?>
Expected result:
----------------
The results is connect expect the warning messages.
Actual result:
--------------
Warning: Illegal offset type in isset or empty in C:\oscommerce\xampp\php\pear\X
ML\Serializer.php on line 713
Warning: Illegal offset type in isset or empty in C:\oscommerce\xampp\php\pear\X
ML\Serializer.php on line 713
Warning: Illegal offset type in isset or empty in C:\oscommerce\xampp\php\pear\X
ML\Serializer.php on line 713
Warning: Illegal offset type in isset or empty in C:\oscommerce\xampp\php\pear\X
ML\Serializer.php on line 713
<?xml version="1.0"?>
<truecolor>
<f id="blue">red</f>
<f id="qqq">green</f>
</truecolor>