|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-10-10 12:44 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
Description: ------------ The Warning: level message that is triggered by preg_replace() when the pattern is a string, but the replacement is an array has one or two typos: "in" instead of "is", and a full stop that looks out of place. Reproduce code: --------------- <?php $pattern = "/foo/"; $replacement = array('bar','baz'); $string = "Womble"; preg_replace($pattern, $replacement, $string); ?> Expected result: ---------------- Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement is an array in C:\test.php on line 8 Actual result: -------------- Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement in an array. in C:\test.php on line 8