Bug #53731 [NEW]: Function arguments can only be changed when native values are given.
| From: | blue-tidus159 at hotmail dot com | Date: | Wed, 12 Jan 2011 21:07:58 +0000 |
| Subject: | Bug #53731 [NEW]: Function arguments can only be changed when native values are given. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-157869@lists.php.net to get a copy of this message | ||
From:
Operating system: Windows 7 x64
PHP version: Irrelevant
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Function arguments can only be changed when native values are given.
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 bug report at http://bugs.php.net/bug.php?id=53731&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53731&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53731&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53731&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53731&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53731&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53731&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53731&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53731&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53731&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53731&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53731&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53731&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53731&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53731&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53731&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53731&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53731&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53731&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53731&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53731&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53731&r=mysqlcfg