Re: Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementslet value dictate parameter type

From: Date: Wed, 12 Oct 2016 16:04:00 +0000
Subject: Re: Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementslet value dictate parameter type
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-96331@lists.php.net to get a copy of this message
On Wed, Oct 12, 2016 at 4:58 AM, Rowan Collins <rowan.collins@gmail.com> wrote: > On 11/10/2016 17:39, Lester Caine wrote: > >> The importance of 'null' in relation to SQL data sets is something that >> PHP seems to push under the carpet a bit. It is essential to the way SQL >> works and so needs to mirror properly which trying to emulate something >> without having the correct metadata defining each field is only ever >> going to be a guess? >> > > It seems pretty trivial to me: SQL distinguishes between the string '' and > null, and so does PHP. If you pass a PHP null to a query, PHP should do as > you say and send an SQL null, and the DB can give an appropriate error if > null is not allowed in that context. Yes, this was straightforward to implement and meant I could revert the changes I made to existing tests.

« previous php.internals (#96331) next »