From:
Operating system: Windows
PHP version: 5.2.13
Package: SimpleXML related
Bug Type: Bug
Bug description:Getting a node with a - in it
Description:
If a XML node have a - in it you can't get the data from it
display-name
echo $channel-display-name;
Notice: Use of undefined constant name - assumed 'name'
Test script:
---
?xml version=1.0 encoding=UTF-8 ?
tv generator-info-name=www.ontv.dk/xmltv
channel id=www.ontv.dk/tv/1
display-name lang=dkDR1 DK/display-name
/channel
/tv
$xml = simplexml_load_string($xml);
$channels = $this-xml-xpath('//channel');
foreach($channels AS $channel) {
echo $channel-display-name;
}
Expected result:
DR1 DK
Actual result:
--
Notice: Use of undefined constant name - assumed 'name'
--
Edit bug report at http://bugs.php.net/bug.php?id=51525edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51525r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51525r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51525r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51525r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51525r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51525r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51525r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51525r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51525r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51525r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51525r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51525r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51525r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51525r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51525r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=51525r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51525r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51525r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51525r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51525r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51525r=mysqlcfg