From 0f27fadf81b66268edf545f13891401b4d53cc38 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 11 Jan 2023 12:56:39 +0100 Subject: [PATCH] Fix GH-2145 (var_export() added leading backslashes in PHP 8.2) --- appendices/migration82/incompatible.xml | 5 +++++ reference/var/functions/var-export.xml | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/appendices/migration82/incompatible.xml b/appendices/migration82/incompatible.xml index 1d2b28ff55ef..b743de952c7f 100644 --- a/appendices/migration82/incompatible.xml +++ b/appendices/migration82/incompatible.xml @@ -86,6 +86,11 @@ ksort and krsort now do numeric string comparison under SORT_REGULAR using the standard PHP 8 rules now. + + + var_export no longer omits the leading backslash for exported classes, + i.e. these are now fully qualified. + diff --git a/reference/var/functions/var-export.xml b/reference/var/functions/var-export.xml index c5880c116dc5..c1d6877008af 100644 --- a/reference/var/functions/var-export.xml +++ b/reference/var/functions/var-export.xml @@ -67,6 +67,13 @@ + + 8.2.0 + + Exported class names are now fully qualified; previously, the leading + backslash was ommitted. + + 7.3.0 @@ -243,7 +250,8 @@ object(A)#2 (2) { - When var_export exports objects, the leading backslash is not included in the class name of namespaced classes for maximum compatibility. + Prior to PHP 8.2.0, when var_export exports objects, + the leading backslash is not included in the class name of namespaced classes for maximum compatibility.