From: cschneid at cschneid dot com
Operating system: Linux
PHP version: Irrelevant
PHP Bug Type: Scripting Engine problem
Bug description: error_handler and array index with function call

Description:
------------
Error handler seems to destroy array indices if called due
to a undefined array index generated by a function.

Reproduce code:
---------------
function handler($errno, $errstr, $errfile, $errline)
{
$test = "aaa";
}

set_error_handler('handler');

$output[trim("bbbbbbb")]++;
print_r($output);


Expected result:
----------------
Array
(
[bbbbbbb] => 1
)


Actual result:
--------------
Array
(
[aaa] => 1
)


--
Edit bug report at [url]http://bugs.php.net/?id=25547&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25547&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25547&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25547&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25547&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25547&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25547&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25547&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25547&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25547&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25547&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25547&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25547&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25547&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25547&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25547&r=gnused[/url]