php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64876 preg_quote is about escaping, not quoting
Submitted: 2013-05-18 07:53 UTC Modified: 2013-06-24 23:18 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: david at grudl dot com Assigned: philip (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [2013-05-18 07:53 UTC] david at grudl dot com
Description:
------------
There is a wrong description for function preg_quote at http://php.net/manual/en/function.preg-quote.php:

Description:
> preg_quote — Quote regular expression characters

Return value: 
> Returns the quoted string.

Correct description:
> preg_quote — Escapes special characters used by regular expression. Name of this function is wrong, it has nothing to do with quoting.

Correct Return value: 
> Returns the escaped string.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-05-19 13:34 UTC] cmbecker69 at gmx dot de
IMO the terms "quote"/"quoting" are absolutely fine here.
Cf. <http://en.wikipedia.org/wiki/Quoting_(shell)>.
 [2013-06-24 23:17 UTC] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=330635
Log: Added the word escaped to help deal with PHP Bug #64876 and added a 'See Also' for good measure.
 [2013-06-24 23:18 UTC] philip@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: philip
 [2013-06-24 23:18 UTC] philip@php.net
The word "escaped" was added to the return description, but "quote" is fine here 
as the function is named preg_quote(). The overall description clarifies the 
behavior of this function.

Thank you for the bug report.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 09:00:02 2026 UTC