Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97254 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79353 invoked from network); 2 Dec 2016 14:22:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2016 14:22:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=thomas@nunninger.info; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=thomas@nunninger.info; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nunninger.info from 87.106.55.207 cause and error) X-PHP-List-Original-Sender: thomas@nunninger.info X-Host-Fingerprint: 87.106.55.207 mail.nunninger.info Linux 2.6 Received: from [87.106.55.207] ([87.106.55.207:38226] helo=mail.nunninger.info) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/C9-01781-29381485 for ; Fri, 02 Dec 2016 09:22:11 -0500 Received: from p5093df94.dip0.t-ipconnect.de ([80.147.223.148] helo=[192.168.178.21]) by mail.nunninger.info with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1cCoho-0001hu-JT; Fri, 02 Dec 2016 14:21:12 +0000 To: Matteo Beccati , Benoit Schildknecht , internals@lists.php.net References: <758680d9-cfe2-4a93-3831-7aa03b4bc9db@nunninger.info> Message-ID: <3dbd220f-4d69-cac5-e45b-1f949f6943f9@nunninger.info> Date: Fri, 2 Dec 2016 15:20:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Spam-Several-Recipients: Yes Subject: Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2 From: thomas@nunninger.info (Thomas Nunninger) Hi, On 12/02/2016 02:54 PM, Matteo Beccati wrote: > On 02/12/2016 08:36, Thomas Nunninger wrote: >> Hi, >> >>> So, if I only want to get the emulated prepared statement, I have to do >>> ob_start()/ob_get_clean(), then use a regexp to fetch it ? I want v1 >>> back T_T >> >> I second that. Why do you print it directly? Wouldn't it be better to >> return a structured array with the information needed? If needed, you >> can var_dump() the array yourself. > > 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. Regards Thomas