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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sun Dec 22 02:01:28 2024 UTC