php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2532 Iterpretation of \
Submitted: 1999-10-15 08:40 UTC Modified: 1999-10-15 17:33 UTC
From: johnny at crescendo dot ro Assigned:
Status: Closed Package: Other
PHP Version: 4.0 Beta 2 OS: SuSE 6.1
Private report: No CVE-ID: None
 [1999-10-15 08:40 UTC] johnny at crescendo dot ro
Maybe I'm too tired at this time, but I think I'm not crazy.

$a="\aa";
$b="\\aa";
if (strcmp($a,$b)==0) echo "Equal";
else echo "Diffrent";

The result is Equal. Maybe is not a bug, may be is the way that PHP see "\" character,
but as I know in C "\a" means "a" and "\\"means"\". 

Is this the way than PHP work or it's a bug?

Sorry for bother you.

Yours,
Bogdan

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-10-15 17:33 UTC] andrei at cvs dot php dot net
That's the way PHP works. If it sees \ followed by something it
does not recognize, it assumes that it's not an escape sequence.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 14:01:34 2024 UTC