php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50985 Backslash not escaped in example while using double qoutes.
Submitted: 2010-02-10 02:44 UTC Modified: 2010-02-10 10:17 UTC
From: j at sights dot de Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: j at sights dot de
New email:
PHP Version: OS:

 

 [2010-02-10 02:44 UTC] 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
---



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-10 10:17 UTC] degeberg@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 03 14:01:30 2024 UTC