php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #33203 Document limitations of var_export()
Submitted: 2005-05-31 16:01 UTC Modified: 2005-11-03 11:46 UTC
From: mfischer@php.net Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2005-05-31 16:01 UTC] mfischer@php.net
Description:
------------
A limitation of var_export() is not documented. It does not support resources. The manual says "generated valid PHP code" which is fine. But it should be noted that resources are not supported, i.e. they're not reflected as resources in var_export anymore.

Reproduce code:
---------------
$ php -r '$f = fopen("/", "r"); var_export($f);'
NULL


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-31 16:02 UTC] mfischer@php.net
According to http://bugs.php.net/bug.php?id=29361 it also doesn't supported objects containing references to other objects. This should be documented too.
 [2005-06-01 11:15 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"Variables of type resource and arrays or objects containing objects couldn't be exported by this function."
 [2005-10-17 10:55 UTC] derick@php.net
I am reopening this as I found a way to do this for classes now.
 [2005-11-03 11:46 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

__set_state documented in var_export() and magic methods.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC