|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-09-23 16:57 UTC] nikic@php.net
[2012-09-23 16:57 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: nikic
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
PHP does not seem to recognize the "\v" escape sequence within strings, like C does. This would probably be an issue in the PHP double-quoted string parser. I'm guessing this has been filed elsewhere as a bug, but I cannot find it (the bug search form does not like \v, '\v' or "\v"). Even though this is documented (language.types.string.php), it is still unexpected. Consider the following code: $s = ereg_replace("[\t\v\n\r ]", '', $s); The intent is to replace all whitespace, where whitespace is defined similarly to isspace(3) (but I forgot '\f', no big deal). The result is that whitespace *and* the "v" character is removed. The letter v is rare enough in English (and vertical tab is almost unheard-of in text) that this can go for a few days without being noticed. In the same vein, \f should also be recognized. I'm not sure about \a and \b, but I would definitely say trigraphs are a bad idea :). Perhaps only a warning would be enough. My copy of the C standard states that when an unknown escape sequence is encountered, the compiler should emit a diagnostic. That seems like reasonable behaviour.