Re: [PROPOSAL] add a leading backslash to classname when serializing/var_exporting
| From: | Steve Clay | Date: | Tue, 09 Apr 2013 13:47:25 +0000 |
| Subject: | Re: [PROPOSAL] add a leading backslash to classname when serializing/var_exporting | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67016@lists.php.net to get a copy of this message | ||
On 4/8/13 11:28 PM, Laruence wrote:
-> https://bugs.php.net/bug.php?id=64554bug is described at #64554
Short term: Add note to the var_export() docs: "For full compatibility with namespaces, the representation must be executed within the root namespace." Proposal seems reasonable to me (as Johannes mentioned, serialize should already be OK). I think we're under no obligation to have serialized forms created in one version work in previous versions [1], though FC of already persisted strings are important. Note this won't solve the problem of existing var_export strings created in past versions. (We'll still need some kind of note.) [1] If an app needs BC of code like \Foo::__set_state(... I would think it'd be easy enough to strip away the escapes. Steve Clay -- http://www.mrclay.org/I proposal to add a leading backslash to all classnames (not only nsnames, since no harm, consistent and make sense) when doing serialize, var_export etc.