Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48405 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9933 invoked from network); 23 May 2010 08:33:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2010 08:33:28 -0000 Authentication-Results: pb1.pair.com header.from=phpwnd@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=phpwnd@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: phpwnd@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:65032] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/07-54147-758E8FB4 for ; Sun, 23 May 2010 04:33:28 -0400 Received: by bwz14 with SMTP id 14so549593bwz.29 for ; Sun, 23 May 2010 01:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=v4GL3iYUZcbKIh0HaSis13YB60SBGw28QOHUHzBHnHc=; b=X6KhGWQamUqDKupAihX5kSGhE81stwScrOhNPWypHGetOQRyz6zpwqtCCAVL2svhkw rZPMHcwIaOZIgrohEmVCM23i8ztRgJXyJsF3SZOfqFG0fa0PsjikCcevtW5cvcHKHtgq QI1QyWutKSSoRN+Lpe5vEApgAeODaq07KsmqU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hPM3boOcHDEGhfY+7EPz5jV8z90y96mHKSf+fTwi/+0fe6pImZGk7WzkmmPdUIA2eA YzY1LJVyEfaVbV/65dMzop0B91qQXVoIw6h0j8d8m6nkkZL+oLauAl6FNlF07IW5hpIo LD29Dkl3BBT4LR3+aDaq9xXkWuT0S9ZXc3qLY= MIME-Version: 1.0 Received: by 10.204.81.80 with SMTP id w16mr1171710bkk.84.1274603604112; Sun, 23 May 2010 01:33:24 -0700 (PDT) Received: by 10.204.67.206 with HTTP; Sun, 23 May 2010 01:33:24 -0700 (PDT) In-Reply-To: <201005230052.05661.larry@garfieldtech.com> References: <7.0.1.0.2.20100522175819.0a601c68@zend.com> <7.0.1.0.2.20100523073125.0a601600@zend.com> <201005230052.05661.larry@garfieldtech.com> Date: Sun, 23 May 2010 10:33:24 +0200 Message-ID: To: php-dev List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Type hinting From: phpwnd@gmail.com (Josh Davis) On Sun, May 23, 2010 at 7:52 AM, Larry Garfield wrote: > > Everything that comes back from a database does > so as a string. To wit: [...] This is not entirely true though. mysqlnd will return native types through PDO or mysqli if you use prepared statements [1] and hopefully other queries someday. [2] As for your example, I think that this usage is within the realm of data validation rather than type checking. The only thing I expect from type checking is to answer this question: "is it an int? Y/N" And that's where the schism is; the "strict" side wants type checking to... well, check the PHP type of a variable. The "weak" side wants to check the contents of a variable. -JD [1] http://blog.ulf-wendel.de/?p=193 [2] http://blog.ulf-wendel.de/?p=198