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