php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39112 Typographical error in error message
Submitted: 2006-10-10 12:25 UTC Modified: 2006-10-10 12:44 UTC
From: a at b dot c dot de Assigned:
Status: Closed Package: PCRE related
PHP Version: 5.1.6 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 - 4 = ?
Subscribe to this entry?

 
 [2006-10-10 12:25 UTC] a at b dot c dot de
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-10 12:44 UTC] tony2001@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 02:02:52 2024 UTC