#46054 [Csd->Opn]: comment of addcslashes 'A..z' is wrong
| From: | miau dot jp at gmail dot com | Date: | Mon, 03 Nov 2008 19:22:29 +0000 |
| Subject: | #46054 [Csd->Opn]: comment of addcslashes 'A..z' is wrong | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-1308@lists.php.net to get a copy of this message | ||
ID: 46054
User updated by: miau dot jp at gmail dot com
Reported By: miau dot jp at gmail dot com
-Status: Closed
+Status: Open
Bug Type: Documentation problem
Operating System: Windows
PHP Version: Irrelevant
New Comment:
Exactly. This is not a bug but a documentation problem.
http://php.net/manual/en/function.addcslashes.php
says ...
// All upper and lower-case letters will be escaped
// ... but so will the [\]^_` and any tabs, line
// feeds, carriage returns, etc.
I think it should be ...
// All upper and lower-case letters will be escaped
// ... but so will the [\]^_`.
Previous Comments:
------------------------------------------------------------------------
[2008-11-02 17:14:21] danbrown@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2008-09-11 15:38:01] miau dot jp at gmail dot com
Description:
------------
http://php.net/manual/en/function.addcslashes.php
says 'A..z' escapes any tabs, line feeds, carriage
retuns. But 'A..z' escapes just upper and lower-case
letters and the [\]^_`.
Reproduce code:
---------------
<?php
for ($n = 0x00; $n < 0x80; $n++) {
$c = chr($n);
$escaped = addcslashes($c, 'A..z');
if (strlen($escaped) == 2) {
print ($n < 0x20 ? $escaped : $c);
}
}
?>
Expected result:
----------------
\t\n\v\f\rABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz
Actual result:
--------------
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46054&edit=1