#41784 [NEW]: casting simplexmlelement to string returns empty
| From: | mistknight at gmail dot com | Date: | Sat, 23 Jun 2007 00:35:36 +0000 |
| Subject: | #41784 [NEW]: casting simplexmlelement to string returns empty | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-114097@lists.php.net to get a copy of this message | ||
From: mistknight at gmail dot com
Operating system: kubuntu feisty 7.04
PHP version: 5.2.3
PHP Bug Type: SimpleXML related
Bug description: casting simplexmlelement to string returns empty
Description:
------------
First of all I admit this was on PHP 5.2.1 and I have my PHP installed
from repository, not compiled. It would be a pain to install PHP 5.2.3
Simply retrieve this ATOM 1.0 file and load it into a simpleXML object
http://www.tbray.org/ongoing/ongoing.atom
Now try to get the <entry>'s nested <content> or <summary> tags as a
string. If you cast your object like so: (string)$obj->content or
(string)$obj->summary you will get an empty string.
Is there ANY workaround for this that will let me retrieve the string? I
tried the docs but there's nothing about this issue. They all say simply
cast to string and I've done that on other simplexmlelement objects without
problems, even elements which had nested tags. Thanks!
Expected result:
----------------
The string located inside the <content></content> or <summary></summary>
tags.
Actual result:
--------------
Empty string.
--
Edit bug report at http://bugs.php.net/?id=41784&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41784&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41784&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41784&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41784&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41784&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41784&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41784&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41784&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41784&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41784&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41784&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41784&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41784&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41784&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41784&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41784&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41784&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41784&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41784&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41784&r=mysqlcfg