-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Implemented FR: Allow error_handler callback parameters to be passed by reference #1018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
62d6a02
to
026fe1a
Compare
Nice work! |
I don't think this patch is acceptable, the patch only cover the $errmsg in a specific situation. we need a common / better patch for all cases like: function error_callback(&$lineno, &$errmsg, &$line, &file) thanks |
I am not sure we should overwrite |
why only one parameter can be reference, but others not? |
I know your concern, I am afraid that modify the lineno and file seems a not good practice, since PHP don't have the ability to use macro, (such as the bison generator did), so I don't know is there any case require it to be a reference parameter. |
Allowing modified errno, line, file is interesting idea. +1 for Laruence idea. Since one can change message, proper file/line may be included in the message. So it's not strictly required. |
Sounds reasonable, I will update it to allow all of the first four (but not context parameter) parameters to support pass by reference. |
I just implemented the ability to pass the first four parameters to be reference. Do I need a RFC for this? |
@reeze could you describe a use-case when someone needs this by-ref here? |
@staabm see the discussion here: http://marc.info/?t=142181539200002&r=1&w=2 One case I want it is I may need to add request uri and logid to errmsg, then our log aggregation system could merge the error message to help monitoring. |
I personally think passing a bunch of params by-ref to change engine internal things like line number is not a good idea. With message, it could work as some kind of a stretch since message is not really an engine thing but with other params I think it's just a bad API. I think if you need custom error reporting just report custom errors. But feel free to submit an RFC and see if there are people that like it. |
@reeze Yes. RFC is needed for this patch. I suggest to have options in the RFC. 1 Make parameter reference For people voted for YES, choose
It would be easier to pass the vote. IMO. |
Thank you guys for your responses! Thomas says he will draft a RFC for it, I will collaborate with him. FYI CC Thomas On 24 January 2015 at 07:46, Yasuo Ohgaki notifications@github.com wrote:
|
Close as RFC been declined. |
Implemented FR: Enable error_handler callback parameters to be passed by reference.
for example, we can now have the ability to modify the errmsg.