ID:              38797
 User updated by: shihewang at yahoo dot com
 Reported By:     shihewang at yahoo dot com
 Status:          Bogus
 Bug Type:        SimpleXML related
 PHP Version:     5.1.6
 New Comment:

Please run the following code to see if it is a bug:
<?php
$xml = simplexml_load_string(
'<?xml version="1.0" encoding="UTF-8" ?> 
  <error-report>  
    <error-number>38797</error-number>
  </error-report>');  
echo $xml->error-number .'<br>';
$xml->error-number = "38798";
echo $xml->error-number;
?>
The message is:
"Parse error: parse error, unexpected '=' in /cgi-bin/testSimpleXML.php
on line 8"
If I replace "error-number" with "error_number",
the changed code works and output:
"38797
38798"
I appreciate all comments. But I hope you test, too.


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

[2006-09-12 19:28:18] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

.

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

[2006-09-12 19:27:31] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



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

[2006-09-12 19:24:33] shihewang at yahoo dot com

Description:
------------
SimpleXml is very good but a small bug. When a node name contaiing '-',
will cause trouble.PHP Interpreter takes '-' as operator. For example,
when set a value to node named "operating-system":
 $xml->operating-system = "Windows";
PHP5 interpreter will report Parse error.





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


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

Reply via email to