#50985 [Opn->Bgs]: Backslash not escaped in example while using double qoutes.

From: Date: Wed, 10 Feb 2010 10:17:07 +0000
Subject: #50985 [Opn->Bgs]: Backslash not escaped in example while using double qoutes.
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3853@lists.php.net to get a copy of this message
ID: 50985 Updated by: degeberg@php.net Reported By: j at sights dot de -Status: Open +Status: Bogus Bug Type: Documentation problem PHP Version: Irrelevant New Comment: Thank you for the report. The \s is not a valid escape sequence in PHP so there is no need for escaping the backslash nor switching to single quotes. You only need to escape a backslash if it would otherwise be regarded as part of an escape sequence, e.g. \\n vs. \n. You can see a list of the escape sequences here: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double Previous Comments: ------------------------------------------------------------------------ [2010-02-10 02:44:47] j at sights dot de Description: ------------ pattern in example #1 is "/[\s,]+/"... but should be single-quoted or the \ needs to be escaped. Reproduce code: --------------- --- From manual page: function.preg-split#Beispiele --- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50985&edit=1

« previous php.doc.bugs (#3853) next »