Re: [PHP-DEV] Exception stack trace string argument

[email protected] (Chris Wright)
Newsgroups php.internals
Message-ID <CAGAGxbbchDwENzu8JKA4UTpko=DMyM-sBEaY0LRJj5j+KquHmA@mail.gmail.com>
On 17 August 2014 00:51, Andu Aanei <[email protected]> wrote:
> Hi,
>
> I am writing this message in order to ask for feedback and advice
> regarding a small feature I wish to implement in the engine.
>
> Currently, when an exception is thrown in a function which has one or
> more string arguments,
> the stack trace shows only the first 15 characters of those arguments.
> This can be annoying and can make debugging harder.

+1

> If, for example, a function throws an exception because of a path to a
> file or a namespace
> passed as a parameter, the developer has to guess the value of that
> argument in order to determine what has caused the exception.
>
> I therefore propose adding an entry in php.ini for specifying the
> maximum length of a string argument in the stack trace.
> For example, zend.stacktrace_str_arg_len
> If the entry is not specified in php.ini, then the default (and
> current) value of 15 will be assigned.
> I guess there are multiple benefits to removing that magic number.

This should have PHP_INI_ALL changeability or it's not that useful IMO

> Everything I have mentioned above is (will be) implemented by me.
>
> If my idea is valid and the reactions are positive, I would also
> appreciate some suggestions such as:
> - Minimum and maximum value for the parameter

Min 0, max unbounded

> - The PHP version this feature should go in

5.7 (assuming it happens, failing that 7) - although that said I
personally would be fine with it going into a 5.6.x point release as
it won't affect production for anyone with a sane development
cycle/environment.

> - A better name for the entry (and whether it should contain the
> "zend" prefix or not)

No useful opinion

> - Does it require an RFC? I think it can be seen both as a bug and as a feature.

Yes, this is more feature than bugfix IMO

> It is probably worth mentioning that this is my first attempt at
> making an open source contribution of this kind and I'm relatively new
> to the process.
>
>
>
> Cheers,
> Andu
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.