Skip to content

Commit

Permalink
Fix GH-2145 (var_export() added leading backslashes in PHP 8.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmb69 committed Jan 11, 2023
1 parent ad458c5 commit 0f27fad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions appendices/migration82/incompatible.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
<function>ksort</function> and <function>krsort</function> now do numeric string
comparison under <constant>SORT_REGULAR</constant> using the standard PHP 8 rules now.
</para>

<para>
<function>var_export</function> no longer omits the leading backslash for exported classes,
i.e. these are now fully qualified.
</para>
</sect2>

<sect2 xml:id="migration82.incompatible.spl">
Expand Down
10 changes: 9 additions & 1 deletion reference/var/functions/var-export.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
</row>
</thead>
<tbody>
<row>
<entry>8.2.0</entry>
<entry>
Exported class names are now fully qualified; previously, the leading
backslash was ommitted.
</entry>
</row>
<row>
<entry>7.3.0</entry>
<entry>
Expand Down Expand Up @@ -243,7 +250,8 @@ object(A)#2 (2) {
</note>
<warning>
<para>
When <function>var_export</function> 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 <function>var_export</function> exports objects,
the leading backslash is not included in the class name of namespaced classes for maximum compatibility.
</para>
</warning>
<note>
Expand Down

0 comments on commit 0f27fad

Please sign in to comment.