Re: [RFC] var_representation() : readable alternative to var_export()
| From: | Rowan Tommins | Date: | Sat, 23 Jan 2021 17:35:25 +0000 |
| Subject: | Re: [RFC] var_representation() : readable alternative to var_export() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112968@lists.php.net to get a copy of this message | ||
On 23/01/2021 00:50, tyson andre wrote:
Hi internals,
I've created https://wiki.php.net/rfc/readable_var_representation based on
my original proposal in https://externals.io/message/112924
This RFC proposes adding a new function var_representation(mixed $value, int $flags=0): string
My hesitation remains that this is just duplicating existing functionality with only cosmetic differences.
As a user of PHP 8.1, how would I decide whether to use print_r, var_dump, var_export, or var_representation?
And under what circumstances would I bother to write "var_representation($var, VAR_REPRESENTATION_SINGLE_LINE);"?
Regards,
--
Rowan Tommins
[IMSoP]