Edit report at http://bugs.php.net/bug.php?id=53731&edit=1
ID: 53731
User updated by: blue-tidus159 at hotmail dot com
Reported by: blue-tidus159 at hotmail dot com
Summary: Function arguments can only be changed when native
values are given.
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Windows 7 x64
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Little typo, i meant:
set_error_handler('errorHandler');
Previous Comments:
------------------------------------------------------------------------
[2011-01-12 22:07:57] blue-tidus159 at hotmail dot com
Description:
------------
The problem with debug_backtrace() is, that only function parameter
values which are native types can be changed, but not if the value is an
object.
Test script:
---------------
<?php
function errorHandler($level, $msg){
$debug = debug_backtrace();
$debug[1]['args'][0]='1';
return true;
}
set_error_handler('error');
function a($a){ // E_RECOVERABLE_ERROR
var_dump($a);
}
class A{}
a(1);
a(2);
a(new A());
?>
Expected result:
----------------
int 1
int 1
int 1
Actual result:
--------------
int 1
int 1
object A
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53731&edit=1