From 6f0a58df79a04142d14cffdf4eae4cfdb519e10d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Mon, 21 Mar 2022 15:39:51 +0100 Subject: [PATCH] Removed warning about missing namespace leading backslash in `var_export()` docs `var_export()` needs to prefix classes it references with `\`, because its code could be transplanted in any source location/namespace, so the assumption of it being used only in the context of the root namespace is not sufficient. For example, in a code snippet like following ( https://3v4l.org/4mONc ): ```php \SomeObject::__set_state(array( )), ) ``` Userland should not concern itself with the contents of the `var_export()`-produced code snippets, and use them as-is instead. Ref: https://github.com/php/php-src/pull/8232 Ref: https://github.com/php/php-src/pull/8233 Ref: https://github.com/Ocramius/ProxyManager/issues/754 --- reference/var/functions/var-export.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/reference/var/functions/var-export.xml b/reference/var/functions/var-export.xml index c5880c116dc5..452d7dc529ca 100644 --- a/reference/var/functions/var-export.xml +++ b/reference/var/functions/var-export.xml @@ -241,11 +241,6 @@ object(A)#2 (2) { or object, use serialize. - - - When var_export exports objects, the leading backslash is not included in the class name of namespaced classes for maximum compatibility. - - To be able to evaluate the PHP generated by var_export,