php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50564 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ...
Submitted: 2009-12-23 18:32 UTC Modified: 2009-12-23 20:48 UTC
From: wyattstorch42 at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.2.12 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wyattstorch42 at gmail dot com
New email:
PHP Version: OS:

 

 [2009-12-23 18:32 UTC] 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 ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-23 20:48 UTC] scottmac@php.net
Works here in PHP 5.3.2-rc1. The usual reason for this happening is an incorrect number of concurrent backslashes.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC