|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-04 16:11 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
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