Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99119 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33932 invoked from network); 19 May 2017 12:35:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 May 2017 12:35:24 -0000 Authentication-Results: pb1.pair.com header.from=php@beccati.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@beccati.com; spf=pass; 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:52771] helo=box.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/69-23431-986EE195 for ; Fri, 19 May 2017 08:35:23 -0400 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 168F6200228; Fri, 19 May 2017 14:35:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=beccati.com; s=mail; t=1495197318; bh=t0F7xXvniVgLbyZNZPs/NdS0WVSCOrBNcZCBtGng0hE=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=GdhzXfwpQ3iJZem08lAM2QPLWOHu8V1HCpfhrittC9JC1MGkncJHliWA2LKDoKG7V WjX+oCqeArwVGwLOsvZjn3XzlihpuAhFxOLi2QqKeh9UdPW5VDoVTzUBZNk2UEh8tF E96s0thV51oT0J8pqmcoo4LvhITkKWQoRmbw1/S/IKB7YRtX6nmSV2zUBFHtsHF+9j WVSDA6bcjl+UIzKOH7i7OXxxOBFNaowIwwJ8fdeoOId/E+alO39cy/DIuIa8LS5ktI x9lpQErv7JJrl4hFmgfNNkKpjI1yHJbrYr/oBXTyUXbUdYd0esr2S9Bs6r7HuMgdhw LtDDVTlyAMrKA== To: Dorin Marcoci References: <002801d2cd97$63921700$2ab64500$@marcodor.com> <000901d2cfad$a0349c60$e09dd520$@marcodor.com> <742d91b6-1435-ca97-16dc-9e54295dfcbd@beccati.com> <000a01d2cfba$e13db4f0$a3b91ed0$@marcodor.com> <6e8a86d3-dcde-e98e-2bb2-555945d628f3@beccati.com> Cc: internals@lists.php.net Message-ID: <9419f9cb-dd21-932a-0075-883f13e00c9e@beccati.com> Date: Fri, 19 May 2017 14:35:15 +0200 MIME-Version: 1.0 In-Reply-To: <6e8a86d3-dcde-e98e-2bb2-555945d628f3@beccati.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PDO Parameter types // PDO::PARAM_AUTO From: php@beccati.com (Matteo Beccati) 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/