#50564 [Opn->Bgs]: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ...
ID: 50564
Updated by: scottmac@php.net
Reported By: wyattstorch42 at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: Linux
PHP Version: 5.2.12
New Comment:
Works here in PHP 5.3.2-rc1. The usual reason for this happening is an
incorrect number of concurrent backslashes.
Previous Comments:
------------------------------------------------------------------------
[2009-12-23 18:32:22] wyattstorch42 at gmail dot com
Description:
------------
Hello,
I have slaved over this one line of code and confirmed that there is
absolutely nothing wrong with it. I have even modified it and received
the same error. The error even persists when the line is commented out.
I receive a parse error as well as a warning for the backslash.
Reproduce code:
---------------
<?php
$contents = "<?php\r\n \$galleryDesc =
\"".addslashes($galleryDesc)."\";\r\n";
?>
Expected result:
----------------
I expected the value of $contents to be:
<?php
$galleryDesc = "...";
Actual result:
--------------
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ...
on line ...
Parse error: syntax error, unexpected T_STRING in ... on line ...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50564&edit=1
Thread (2 messages)