Re: Re: [RFC] Debugging PDO Prepared Statement Emulation v2

From: Date: Fri, 02 Dec 2016 14:20:44 +0000
Subject: Re: Re: [RFC] Debugging PDO Prepared Statement Emulation v2
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-97254@lists.php.net to get a copy of this message
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

« previous php.internals (#97254) next »