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