#46054 [Opn->Csd]: comment of addcslashes 'A..z' is wrong

From: Date: Tue, 04 Nov 2008 16:55:44 +0000
Subject: #46054 [Opn->Csd]: comment of addcslashes 'A..z' is wrong
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1321@lists.php.net to get a copy of this message
ID: 46054 Updated by: vrana@php.net Reported By: miau dot jp at gmail dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Windows PHP Version: Irrelevant New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "All upper and lower-case letters will be escaped ... but so will the [\]^_`." Previous Comments: ------------------------------------------------------------------------ [2008-11-03 19:22:29] miau dot jp at gmail dot com 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 [\]^_`. ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#1321) next »