Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97256 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83315 invoked from network); 2 Dec 2016 14:51:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2016 14:51:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@beccati.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@beccati.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain beccati.com designates 176.9.123.236 as permitted sender) X-PHP-List-Original-Sender: php@beccati.com X-Host-Fingerprint: 176.9.123.236 box.beccati.com Received: from [176.9.123.236] ([176.9.123.236:60664] helo=box.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/8A-01781-37A81485 for ; Fri, 02 Dec 2016 09:51:33 -0500 Received: from authenticated-user (box.beccati.com [176.9.123.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by box.beccati.com (Postfix) with ESMTPSA id A5B33200181; Fri, 2 Dec 2016 15:51:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=beccati.com; s=mail; t=1480690288; bh=e6uUKMcTqquNx4Xm0INoKk+7+JYYgklj5uAcI0MuCpU=; h=Subject:To:References:From:Date:In-Reply-To:From; b=dg5dWiF/96Wg5BdUffep6U7qqNcifzQo87bd8F9ospUgBfqiQcqu9fCqGorQOUbRv g6pb3U0YvtLmyrkrzUCIQySEk0HRmv4u4620dQ8rfik3gp2wDooWCQ0jJ/XZjJwARs BVdAHuxCjuBOk0Sva3iWH2W+CQlAd4XYXrY44wBGb504tWCs2dSXoRcMtSaZcIdEf4 556YT5wns03u6XLSMfC3lhzws8vt/jv1LWSzHtG8pYnf/YlD264eGc7i5uUY1bmCjW K3KR1G9/SsRLnTieXrgG70tln+rapibLwIHVBwbdeop+62LGx9ISHQIJjmVVdg4o0B OOqlaPdhYThCA== To: Thomas Nunninger , Benoit Schildknecht , internals@lists.php.net References: <758680d9-cfe2-4a93-3831-7aa03b4bc9db@nunninger.info> <3dbd220f-4d69-cac5-e45b-1f949f6943f9@nunninger.info> Message-ID: <0f3432db-537f-2711-12e9-33e43857af98@beccati.com> Date: Fri, 2 Dec 2016 15:51:20 +0100 MIME-Version: 1.0 In-Reply-To: <3dbd220f-4d69-cac5-e45b-1f949f6943f9@nunninger.info> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2 From: php@beccati.com (Matteo Beccati) Hi, On 02/12/2016 15:20, Thomas Nunninger wrote: >> Could you please explain what's the use case? As far as I'm concerned >> such information would only be useful during PDO driver development, >> phpt files and bug reporting / fixing. > > Sometimes I'd like to log what SQL is really used that I can > analyze/modify a query without the need to replace all bound parameters > manually before applying it to the command line of my database. > > Additionally, it's a matter of good style in my opinion. E.g. if you > return an array you can extend the structure later. If some test checks > a string output you have to change this. If it checks the values of some > array keys, the test is stable as long as you just add new keys. Your planned usage only applies if you use emulated prepared statements, so it's not really something one should depend on. That said, alas the only debug facility in PDO prints directly to output. Version 1 of this RFC added something completely different and v2 fixes it re-using what PDO already has. If you ask me, what PDO offers sucks, but that's what we've got and improving it is out of scope for this RFC. Anyone could create a new RFC to add array output to debugDumpParams, that would be most welcome. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/