Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15122 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58449 invoked by uid 1010); 20 Feb 2005 14:44:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58381 invoked from network); 20 Feb 2005 14:44:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2005 14:44:47 -0000 X-Host-Fingerprint: 64.233.184.199 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.199:24121] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 1.2 (r4437)) with SMTP id 1F/67-12222-E52A8124 for ; Sun, 20 Feb 2005 09:44:46 -0500 Received: by wproxy.gmail.com with SMTP id 63so294651wri for ; Sun, 20 Feb 2005 06:44:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=sfzShuLENq7QCkMkjdq6jMsr/heazhZm0hrhDhJWgLZwCD4aFtb9E+M8HZU1v1xDJiu6Uw20JbrC29fhYbxB3GY39zpNZxToGxu7Ukll3WYT2J65bWqMdg28z00dZR4IYhb7G7dGvr80slg6TCZMJQSU0GFGp0oekhFloCy3e+g= Received: by 10.54.19.29 with SMTP id 29mr287350wrs; Sun, 20 Feb 2005 06:44:41 -0800 (PST) Received: by 10.54.59.22 with HTTP; Sun, 20 Feb 2005 06:44:41 -0800 (PST) Message-ID: <4e89b42605022006445681add4@mail.gmail.com> Date: Sun, 20 Feb 2005 09:44:41 -0500 Reply-To: Wez Furlong To: Timm Friebe Cc: internals@lists.php.net In-Reply-To: <1108899361.316.63.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1108836903.316.40.camel@localhost> <42185C0B.3000308@php.net> <1108899361.316.63.camel@localhost> Subject: Re: [PHP-DEV] Re: PDO types From: kingwez@gmail.com (Wez Furlong) On Sun, 20 Feb 2005 12:36:01 +0100, Timm Friebe wrote: > * If the number does not fit, I will try to convert it into a double > (PHP datatype float). This is the case for e.g. numeric(10) - values > might not fit. This is the same what PHP does when adding 1 to > LONG_MAX, for instance. If - in the procedure of doing so, strtod() > gives an ERANGE or if the length overflows EG(precision), I will > return a string. This is exactly what I wanted to avoid. Please don't make this change. > For "floats" > * If the length of the returned value exceeds EG(precision) or if > strtod() returns an ERANGE, I will return a string; a float otherwise. "Thou shall only return a float if the database passes you back a float; thou shalt not convert data into the floating point type." Floats suck. If the database gives you a decimal, pass it back as a string. > Talking about that, maybe PDO should start returning Date objects > instead of stupid string representations or sequences of numbers of > those (where users will start preg_match()ing or strtotime()ing around > if they want to do arithmetic with the returned value)... Derick and Pierre have something in mind for the future. --Wez.