var_export() Format
PHP used to export an object with a fully qualified name, except for the first backslash. Since PHP 8.2, the name is a fully qualified one, and may be used in any namespace, without adaptation.
PHP code
<?php
class X {}
var_export(new X);
?>
Before
\X::__set_state(array(
))
After
\\X::__set_state(array(
))
PHP version change
This behavior changed in 8.2.
See Also
- var_export() combined with enum produces code unsuitable for inclusion in namespaces
- Add leading backslash to enum and class names in var_export