Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50102 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67783 invoked from network); 5 Nov 2010 00:37:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2010 00:37:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain l-i-e.com designates 67.139.134.202 as permitted sender) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:3989] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/2A-30572-6D153DC4 for ; Thu, 04 Nov 2010 19:37:43 -0500 Received: (qmail 19385 invoked by uid 98); 5 Nov 2010 00:37:45 -0000 Received: from localhost by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.05 ( Clear:RC:1(127.0.0.1):. Processed in 0.037845 secs); 05 Nov 2010 00:37:45 -0000 Received: from localhost (HELO www.l-i-e.com) (127.0.0.1) by localhost with SMTP; 5 Nov 2010 00:37:45 -0000 Received: from webmail (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Thu, 4 Nov 2010 19:37:45 -0500 Message-ID: <24c7fdf08ac80c097306908d0c4b5512.squirrel@www.l-i-e.com> In-Reply-To: References: Date: Thu, 4 Nov 2010 19:37:45 -0500 To: internals@lists.php.net User-Agent: SquirrelMail/1.4.21 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] PDO_DBLIB Native PHP Type binding From: ceo@l-i-e.com ("Richard Lynch") On Wed, November 3, 2010 8:52 pm, Stanley Sufficool wrote: > Before I gut PDO_DBLIB one more time to implement native parameter > binding for stored procedures, what are the thoughts on returning the > column values from the database as the native PHP type when possible? > Currently everything is returned as a string, incurring overhead for > conversion and creating problems hinting at the desired binding type > for BLOBS and numeric data types. It *SEEMS* like a Good Idea (tm) until you think it through and realize that there is NOT a one-to-one correspondence between PHP native types and DB native types. Even what seems like a no-brainer for, say, INT is not. Does PHP INT have the same range as the DB INT? Dollars to doughnuts says "No." is the correct answer. BIGINT? Not a chance. PHP doesn't really do bigint, unless you want to return some GMP thing, which is probably not a Good Idea, as GMP isn't always there, I don't think. Then you start looking at things like an enum, or GeoIP, or IP address as native DB types, and it gets really ugly, really fast. -- brain cancer update: http://richardlynch.blogspot.com/search/label/brain%20tumor Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE