ID: 48847 User updated by: an0nym at narod dot ru Reported By: an0nym at narod dot ru -Status: Feedback +Status: Open Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.2.10, 5.3.0 New Comment:
I agree that manual doesn't document anything related to this issue - according to manual behaviour in this particular case is undefined, so de jure this is not a bug. However, I think behaviour should be at least equal in both cases I provided. Moreover, I don't see the point of triggering recoverable error when you can't influence the cause of it. > I am surprised that it is possible to change function parameters in the error handler, and I don't think it is supported behavior. I think it is OK to change function parameters in the error handler for catchable error which these function parameters were reason for. Maybe debug_backtrace() is not the appropriate tool to get there parameters, but there is no other. Previous Comments: ------------------------------------------------------------------------ [2009-08-25 07:21:42] [email protected] Thank you for your bug report. Why do you think it should be possible what you are trying to do? The documentation for debug_backtrace does not describe that it returns a reference. I am surprised that it is possible to change function parameters in the error handler, and I don't think it is supported behavior. ------------------------------------------------------------------------ [2009-07-08 08:00:43] an0nym at narod dot ru Description: ------------ When argument of function or method is defined with type declaration and default value and is called with some value of this argument, debug_backtrace() doesn't reference this argument of function in stack. When function definition is the same except argument doesn't have default value, everything goes normal. Reproduce code: --------------- <?php function error($message,$number){ $traces=debug_backtrace(); $traces[1]['args'][0]='1'; return TRUE; } set_error_handler('error'); function a(anyUndefinedType $a){ // E_RECOVERABLE_ERROR var_dump($a===1,$a==='1'); } function b(anyUndefinedType $b=NULL){ // E_RECOVERABLE_ERROR var_dump($b===1,$b==='1'); } a(1); b(1); ?> Expected result: ---------------- bool(false) bool(true) bool(false) bool(true) Actual result: -------------- bool(false) bool(true) bool(true) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48847&edit=1
