Re: Escape \0 in var_dump() output

From: Date: Thu, 27 May 2021 11:00:28 +0000
Subject: Re: Escape \0 in var_dump() output
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-114631@lists.php.net to get a copy of this message
Hey, > whether var_dump() should be performing any escaping at all, and if yes Well, since var_dump is essentially for debugging purposes, it makes sense to escape certain characters. Like you mentioned, some IDEs do not print/support null bytes. Hence, I am all for it, as it simplifies debugging in that scenario (which is the main objective). > how much we should be escaping. Just \0, both \0 and \ to avoid ambiguity, or a larger set of control characters? Probably a larger set of control characters as well. As mentioned before, var_dump is for *debugging*, if you can not get full debugging information, it will only lead to headaches and frustrations. Regardless, I do believe we should provide some kind of 'setting' for this in php.ini (like precision for example) just so the user can decide what they want to do.

« previous php.internals (#114631) next »