Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83447 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24844 invoked from network); 21 Feb 2015 23:26:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2015 23:26:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:34257] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/FA-08895-D0419E45 for ; Sat, 21 Feb 2015 18:26:07 -0500 Received: (qmail 21818 invoked by uid 89); 21 Feb 2015 23:26:02 -0000 Received: by simscan 1.3.1 ppid: 21811, pid: 21814, t: 0.0770s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@86.189.147.37) by mail4.serversure.net with ESMTPA; 21 Feb 2015 23:26:02 -0000 Message-ID: <54E91409.50308@lsces.co.uk> Date: Sat, 21 Feb 2015 23:26:01 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PDO_DBLIB type handling From: lester@lsces.co.uk (Lester Caine) On 21/02/15 22:12, Yasuo Ohgaki wrote: >> This driver returns all column data as a string, regardless of how it's >> > represented in the DB. I created a patch for my own use that syncs up the >> > type handling with the behavior of the MSSQL extension. This seems like it >> > would be of general use. Does anyone have any feedback before I put >> > together an RFC? My main question would be whether people would rather have >> > this be the default/only behavior, or whether it should be opted into >> > via PDO::ATTR_STRINGIFY_FETCHES. >> > > Databases return "string" data to return correct data in DB. > Most obvious is "NUMERIC" data type. NUMERIC has any precision. > We may have 128 bit INT in near future also. > > So it should return string by default, PHP may convert types into > PHP native types optionally. Not the other way around. IMHO. It is probably worth pointing to date and time types as a good example of where there is not practical to take a binary view of the data since there are a number of differences between databases, and up until now it has only been safe to use 32bit numbers directly in PHP which is additional reasons for keeping to a string base. ( Since all of my material is managed via databases it is also why I am normally using 'stringy ints'! ) -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk