Req #80780 [NEW]: var_export return an empty an incomplete representation
| From: | glash dot gnome at gmail dot com | Date: | Sun, 21 Feb 2021 15:55:02 +0000 |
| Subject: | Req #80780 [NEW]: var_export return an empty an incomplete representation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232309@lists.php.net to get a copy of this message | ||
From: glash dot gnome at gmail dot com
Operating system: GNU Lunix
PHP version: Irrelevant
Package: DOM XML related
Bug Type: Feature/Change Request
Bug description:var_export return an empty an incomplete representation
Description:
------------
If I var_export() a DOMDocument, I get an incomplete representation of
the DOM data.
"That's funny, it did it a moment ago."
If I var_dump() a DOMDocument, I get a complete representation of the
DOM data.
"So then I tried SimpleXML"
If I use SimpleXML, var_export() and var_dump() returns me a full
representation of data.
"Show me."
In an extension, to enable var_dump() we need to implement :
zend_object_handlers.get_debug_info
What should be implemented to enable var_export() ?
Test script:
---------------
$doc = new DOMDocument();
$doc->loadXML("<root><item>Text</item></root>");
var_export($doc);
Expected result:
----------------
DOMDocument::__set_state(array(
'doctype' => NULL,
'implementation' => '(object value omitted)',
'documentElement' => '(object value omitted)',
'actualEncoding' => NULL,
'encoding' => NULL,
'xmlEncoding' => NULL,
'standalone' => true,
'xmlStandalone' => true,
'version' => '1.0',
'xmlVersion' => '1.0',
'strictErrorChecking' => true,
'documentURI' => '[...]',
'config' => NULL,
'formatOutput' => false,
'validateOnParse' => false,
'resolveExternals' => false,
'preserveWhiteSpace' => true,
'recover' => false,
'substituteEntities' => false,
'nodeName' => '#document',
'nodeValue' => NULL,
'nodeType' => 9,
'parentNode' => NULL,
'childNodes' => '(object value omitted)',
'firstChild' => '(object value omitted)',
'lastChild' => '(object value omitted)',
'previousSibling' => NULL,
'nextSibling' => NULL,
'attributes' => NULL,
'ownerDocument' => NULL,
'namespaceURI' => NULL,
'prefix' => '',
'localName' => NULL,
'baseURI' => '[...]',
'textContent' => 'Text',
))
Actual result:
--------------
DOMDocument::__set_state(array(
))
--
Edit bug report at https://bugs.php.net/bug.php?id=80780&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80780&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80780&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80780&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80780&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80780&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80780&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80780&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80780&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80780&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80780&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80780&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80780&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80780&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80780&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80780&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80780&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80780&r=mysqlcfg