Re: type hinting

From: Date: Sat, 05 Jan 2008 00:32:31 +0000
Subject: Re: type hinting
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-34495@lists.php.net to get a copy of this message
Andi Gutmans wrote:
Look it boils down to the following: True type enforcement ala === (i.e. you pass "1" to an int and it errors out) does not make sense for PHP (and yes, philosophy and design goals of the language are important). What I suggested in my previous email is type hinting which also does the conversion to the request type. This is very much in the PHP spirit and also how PHP's internal functions work today. It is "consistent".
I agree (and did last time) with Andi about this. I am all for using a == instead of === for type hinting scalars. This will mean any scalar will pass as a string, but arrays and objects will not. -- Brian Moon Senior Developer ------------------------------ When you care enough to spend the very least. http://dealnews.com/

« previous php.internals (#34495) next »