Re: [RFC] Escape PDO "?" parameter placeholder
| From: | Nikita Popov | Date: | Tue, 02 Jul 2019 14:55:40 +0000 |
| Subject: | Re: [RFC] Escape PDO "?" parameter placeholder | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-106127@lists.php.net to get a copy of this message | ||
On Tue, Jul 2, 2019 at 4:42 PM Thomas Hruska <thruska@cubiclesoft.com>
wrote:
> On 7/2/2019 6:07 AM, Nikita Popov wrote:
> > that it also exists elsewhere). The RFC argues against this because it
> > makes writing a literal \? harder (which would be \\\\?), but I think
> that
>
> \\? should result in the correct string. \\\\? adds in an extra backslash.
>
I guess I should clarify that I meant use in a quoted string. In that case
"\\\\?" becomes \\? after PHP is done with it, and \? after PDO is done
with it. Of course, if you use nowdoc for SQL queries, then it would be
just \\?.
In any case, I'm also fine with the ?? escaping, this is just a preference.
Nikita