Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

© 2023-2026, Damien Seguy - Exakat