Re: Type hinting

From: Date: Sun, 23 May 2010 08:33:24 +0000
Subject: Re: Type hinting
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-48405@lists.php.net to get a copy of this message
On Sun, May 23, 2010 at 7:52 AM, Larry Garfield <larry@garfieldtech.com> 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

« previous php.internals (#48405) next »