Re: Bug(?) in quotes and \ escaping

From: Date: Sat, 09 Dec 2000 22:10:59 +0000
Subject: Re: Bug(?) in quotes and \ escaping
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29502@lists.php.net to get a copy of this message
Quote from: http://www.php.net/manual/language.types.string.php The second way to delimit a string uses the single-quote ("'") character. When a string is enclosed in single quotes, the only escapes that will be understood are "\\" and "\'". This is for convenience, so that you can have single-quotes and backslashes in a single-quoted string. Variables will not be expanded inside a single-quoted string. Matthew At 08:48 PM 12/9/2000 +0200, you wrote:
Is this a bug?
$l = '\';     <--- syntax error,
                   in the next line as the string is not terminated(!)
$l = '\\'     <--- correct, $l is assigned the value of a single \
I thought that only double-quotes (") interpret what's inside them. The goal here is to assign $l a single baskslash char.


« previous php.general (#29502) next »