Edit report at https://bugs.php.net/bug.php?id=78683&edit=1
ID: 78683
Updated by: nikic@php.net
Reported by: 6562680 at gmail dot com
Summary: [ Feature ] Add function to safely print nested
objects / arrays in Exceptions
Status: Not a bug
Type: Feature/Change Request
Package: *General Issues
Operating System: Win10
PHP Version: 7.3.10
-Block user comment: No
+Block user comment: Yes
Private report: N
New Comment:
Moderation note: Comment by "jdjdirjdktidie at shutup dot com" removed and further
comments on this bug disabled.
Adding this kind of functionality requires an RFC (https://wiki.php.net/rfc/howto). In this
particular case, at least a reference implementation in PHP, examples of the produced output, as
well as intended usage scenarios should be outlined in the proposal.
For the record, I do think that some functionality like this could be useful (another application
would be phpt tests), but it needs a more careful outline before a useful discussion can be started
on it. The description in this feature request is somewhat ... rambling.
Previous Comments:
------------------------------------------------------------------------
[2019-10-19 07:35:12] 6562680 at gmail dot com
just... little bit confused about my life was PHP all 12 years i spent for that shit. 12 damn years.
i imaged the reason for each comma i put in my code, know how to write fastest the faster.
but the dev team recommends me asking "all the community" of people who writing 1/2 years
to be agree, and spent 2 years to build my own authority (what? likes? followers? what is need to
get some votes from people today)?
no problem. just continue to speak. i'd better to do my job without ideas, suggestions,
complaining and so on. its useless.
------------------------------------------------------------------------
[2019-10-19 07:28:38] 6562680 at gmail dot com
understand all about php.
array_map(func, array)
but array_filter(array, func)
i can put here 12 bugs that makes me angry from
but instead of make it better, we talking talking talking. creating rfc, explaining and deny
features by any reason
i tried 6 times (there is 1 time) - nothing changed.
i understand the logic of community speech php is dead
its not dead, its freezed.
------------------------------------------------------------------------
[2019-10-19 02:24:20] requinix@php.net
Here's the thing. Adding a new function to the core because someone doesn't like the 8 (I
forgot debug_zval_dump) or more functions that serve a similar purpose isn't enough of a reason
to do so. The whole point of allowing people to write their own classes and functions is
specifically because PHP won't have everything already, and sharing that custom code between
projects is why PEAR and Composer exist.
So here's my offer. Go on the internals mailing list and see what they think - I'm not
saying this needs an RFC, just to talk about it - and if they agree with you that another function
is warranted then so be it.
------------------------------------------------------------------------
[2019-10-19 00:37:57] 6562680 at gmail dot com
oh my bad i wrote topic name "safely print"
i mean safely for interpreter
you know, when you calling "is_nan" (that returns bool) you could get fatal error like
"you variable is not a float", i mean "safely for that stuff"
(strval) object -> fatal "non-stringable"
i mean without this fatals everywhere that could be solved only with if/else
------------------------------------------------------------------------
[2019-10-19 00:22:45] 6562680 at gmail dot com
String could be { String(27) "My\0BadString\27With\t\nTabs...." }
// split vars with 1 space
logval(...$arguments)
// cut every output to maxlen then wrap with '{ <Type> [#<id>] <Cutstr> }
printval(int $maxlen, ...$arguments);
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=78683
--
Edit this bug report at https://bugs.php.net/bug.php?id=78683&edit=1