#31804 [Opn->Bgs]: Problem with \ in single quotes ('abc\')
| From: | derick@php.net | Date: | Wed, 02 Feb 2005 07:40:26 +0000 |
| Subject: | #31804 [Opn->Bgs]: Problem with \ in single quotes ('abc\') | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-73243@lists.php.net to get a copy of this message | ||
ID: 31804
Updated by: derick@php.net
Reported By: neo_in_matrix at msn dot com
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: Windows, Fedora Core 1 & 3
PHP Version: Irrelevant
New Comment:
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
.
Previous Comments:
------------------------------------------------------------------------
[2005-02-02 04:37:48] neo_in_matrix at msn dot com
Description:
------------
It seems there is a small problem with the \ char in single quotes.
I think the char \ is *not* an escape char in single quotes, as
echo 'abc\x';
outputs
abc\x
But, the following code
echo 'abc\';
gives an error:
PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or
';' in x:\test.php on line 1
However, the code
echo 'abc\\';
has no runtime error and it outputs
abc\
but it should output (with two \ chars)
abc\\
Reproduce code:
---------------
echo 'abc\x';
echo 'abc\\';
echo 'abc\';
Expected result:
----------------
abc\x
abc\\
abc\
Actual result:
--------------
abc\x
abc\
PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or
';' in x:\test.php on line 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31804&edit=1