Bug #64554 [NEW]: var_export does not export absolute namespace for classname
From: cornelius dot howl at gmail dot com
Operating system: Any
PHP version: 5.4.13
Package: *General Issues
Bug Type: Bug
Bug description:var_export does not export absolute namespace for classname
Description:
------------
---
From manual page:
http://www.php.net/function.var-export#refsect1-function.var-
export-description
---
If I defined a class "Foo\Bar\C" that implements __set_state method, then
use
var_export to export the php code, and put this exported code to another
namespace, it will causes "class not found".
because the exported class name is "Foo\Bar\C" not "\Foo\Bar\C", the class
can not
be found without the root namespace. :(
var_export should always export the root namespace.
--
Edit bug report at https://bugs.php.net/bug.php?id=64554&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64554&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64554&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64554&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64554&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64554&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64554&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64554&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64554&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64554&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64554&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=64554&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=64554&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64554&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64554&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64554&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64554&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64554&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64554&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64554&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64554&r=mysqlcfg
Thread (4 messages)
- cornelius dot howl at gmail dot com