Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88069 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37393 invoked from network); 6 Sep 2015 23:23:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Sep 2015 23:23:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:33382] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/01-26858-BDACCE55 for ; Sun, 06 Sep 2015 19:23:07 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 896004DEA5; Mon, 7 Sep 2015 01:23:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-93-104-0-60.dynamic.mnet-online.de [93.104.0.60]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id A55F34DEA0; Mon, 7 Sep 2015 01:23:04 +0200 (CEST) Message-ID: <1441581781.24572.8.camel@kuechenschabe> To: Andrea Faulds Cc: internals@lists.php.net Date: Mon, 07 Sep 2015 01:23:01 +0200 In-Reply-To: <7A.E4.59944.DF67CE55@pb1.pair.com> References: <7A.E4.59944.DF67CE55@pb1.pair.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: PDO: Disable emulated prepares by default? From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Sun, 2015-09-06 at 18:25 +0100, Andrea Faulds wrote: > 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 Good enough to take the performance hit by the extra roundtrip? > 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. For some definition of "properly". Large integers might still become strings, same for decimals etc. Also if you might use other databases than MySQL still anything might happen. Also mind that there are subtle differences on what can be done. A bit constructed example but in MySQL you can't prepare CREATE TABLE foo (id INT DEFAULT ?) while PDO would let you do this. johannes