ID:               40710
 Updated by:       [EMAIL PROTECTED]
 Reported By:      zend at ryank dot net
-Status:           Open
+Status:           Closed
 Bug Type:         Strings related
 Operating System: Windows XP SP2
 PHP Version:      5.2.1
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2007-03-03 16:47:00] zend at ryank dot net

Description:
------------
Using str_ireplace on array elements passed to a function causes PHP
crash or apache(2.2.4) crash if the needle is not found.

In the repo code, if you use the line:

$record = array('DocumentDate' => '2007-03-02');

It will function correctly.

Workaround: use str_replace

Reproduce code:
---------------
function test($rec)
{
    $preped = array();
    $preped['DocumentDate'] =
str_ireplace('-','',$rec['DocumentDate']);

    print ' prep okay? ';
    return $preped;
}


$record = array('DocumentDate' => '20070302');

print ' alive ';

$record = test($record);

print_r($record);

print ' alive ';

Expected result:
----------------
alive prep okay? Array ( [DocumentDate] => 20070302 ) alive 

Actual result:
--------------
php crash or apache crash referencing php5ts.dll


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40710&edit=1

Reply via email to