Re: [RFC][DISCUSSION] Change var_export() array syntax to use shorthand arrays
| From: | Andrea Faulds | Date: | Sun, 29 Mar 2020 22:42:30 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Change var_export() array syntax to use shorthand arrays | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109440@lists.php.net to get a copy of this message | ||
Hi again,
Andrea Faulds wrote:
Hi Sherif, Sherif Ramadan wrote:Oops, I forgot about classes with ::__set_state! (I only thought about stdClass because it was me that added support for it, unlike for __set_state.) That also uses the old array syntax. Thanks and sorry for spam, AndreaI'm proposing a new RFC to change var_export()'s array syntax to use the short hand array syntax instead. The RFC is available here https://wiki.php.net/rfc/var-export-array-syntax This is a forwards-compatible change proposed for and targeting PHP 8.0. I'd like to open up discussion.What about stdClass? That is currently exported using an object cast applied to an array literal, and that array literal uses long array syntax for consistency. I think this should be mentioned in the RFC, whatever choice you make.