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.
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.

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
- The PHP version this feature should go in
- A better name for the entry (and whether it should contain the
"zend" prefix or not)
- Does it require an RFC? I think it can be seen both as a bug and as a feature.

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

Reply via email to