Edit report at https://bugs.php.net/bug.php?id=48847&edit=1

 ID:                 48847
 Updated by:         s...@php.net
 Reported by:        an0nym at narod dot ru
 Summary:            debug_backtrace() doesn't reference arguments in
                     stack in some cases
-Status:             Open
+Status:             Not a bug
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 Operating System:   *
 PHP Version:        5.2.10, 5.3.0
 Block user comment: N
 Private report:     N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Modifying debug traces is definitely not a supported functionality.


Previous Comments:
------------------------------------------------------------------------
[2009-08-25 09:04:50] an0nym at narod dot ru

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.

------------------------------------------------------------------------
[2009-08-25 07:21:42] sjo...@php.net

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 https://bugs.php.net/bug.php?id=48847&edit=1

Reply via email to