From: an0nym at narod dot ru
Operating system: *
PHP version: 5.3.0
PHP Bug Type: Unknown/Other Function
Bug description: debug_backtrace doesn't reference arguments in stack in some
cases
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 bug report at http://bugs.php.net/?id=48847&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48847&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48847&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48847&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48847&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48847&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48847&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48847&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48847&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48847&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48847&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48847&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48847&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48847&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48847&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48847&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48847&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48847&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48847&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48847&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48847&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48847&r=mysqlcfg