Re: PDO Parameter types // PDO::PARAM_AUTO

From: Date: Fri, 19 May 2017 12:35:15 +0000
Subject: Re: PDO Parameter types // PDO::PARAM_AUTO
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-99119@lists.php.net to get a copy of this message
Hi Dorin, On 18/05/2017 12:17, Matteo Beccati wrote: > Hi Dorin, > > On 18/05/2017 11:41, Dorin Marcoci wrote: >> I meant the case when a bool is passed as string, like bindValue('boolparam', >> false); >> Here it comes as an empty string, not "0", while true comes as "1". > > Please have a look again at my example and the code I linked. How could > it work if what you say is true? > > Please note that the code is in the PDO_PARAM_EVT_EXEC_PRE case. I'll try again, maybe it's clearer this way: Breakpoint 1, pgsql_stmt_param_hook (stmt=0x7ffff1681000, param=0x7ffff16801e0, event_type=PDO_PARAM_EVT_EXEC_PRE) at .../ext/pdo_pgsql/pgsql_statement.c:383 383 S->param_values[param->paramno] = Z_TYPE_P(parameter) == IS_TRUE ? "t" : "f"; (gdb) printzv parameter [0x7ffff16801e0] bool: false It's not an empty string. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/

« previous php.internals (#99119) next »