Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88063 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15241 invoked from network); 6 Sep 2015 17:25:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Sep 2015 17:25:18 -0000 X-Host-Fingerprint: 2.122.81.212 unknown Received: from [2.122.81.212] ([2.122.81.212:29339] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/E4-59944-DF67CE55 for ; Sun, 06 Sep 2015 13:25:18 -0400 Message-ID: <7A.E4.59944.DF67CE55@pb1.pair.com> To: internals@lists.php.net References: Date: Sun, 6 Sep 2015 18:25:13 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 2.122.81.212 Subject: Re: PDO: Disable emulated prepares by default? From: ajf@ajf.me (Andrea Faulds) Hi Scott, Scott Arciszewski wrote: > Inspired by http://stackoverflow.com/a/12202218/2224584 > > Can we (in either PHP 7.0 or in PHP 7.1) turn emulated prepared > statements off by default, and still allow developers to turn it on if > they really want them? > > For now my code works around this design decision, but not everybody > is cognizant of this behavior. I don't know if there's really still time to add this in PHP 7.0, but I think emulated prepares being switched off would be a good idea. One reason in particular is that this means we'd get properly typed results, rather than just strings, which would work better with PHP 7's new scalar type hints. PDO returning strings everywhere when using emulation was one thing I was completely unaware of until I turned on strict typing. Cheers. -- Andrea Faulds http://ajf.me/