ID:               45422
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ales dot loncar at internet-solutions dot si
 Status:           Feedback
 Bug Type:         XML Writer
 Operating System: Mac OS X 10.5.2
 PHP Version:      5.2.6
 New Comment:

For the information, works like a charm on windows and linux.

Scott, have you tried the script?


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

[2008-07-02 23:05:08] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

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

[2008-07-02 23:00:10] ales dot loncar at internet-solutions dot si

Description:
------------
Creation of new xmlwriter using memory fails. Script stops at same
line. In Apache error log notice is writen:
[notice] child pid 363 exit signal Bus error (10)

Reproduce code:
---------------
$data = array(
    "foo" => 456,
    "bar" => 789,
    "aaa" => array(
        "abc" => 111
    )
);

$xml = new XmlWriter();
$xml->openMemory(); // script stopes in this line
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('root');

function write(XMLWriter $xml, $data){
    foreach($data as $key => $value){
        if(is_array($value)){
            $xml->startElement($key);
            write($xml, $value);
            $xml->endElement();
            continue;
        }
        $xml->writeElement($key, $value);
    }
}
write($xml, $data);

$xml->endElement();
echo $xml->outputMemory(true);

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<root><foo>456</foo><bar>789</bar><aaa><abc>111</abc></aaa></root>

Actual result:
--------------
Blank Screen


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


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

Reply via email to