Re: [RFC] Type hints (parameter and return value)

From: Date: Thu, 17 Apr 2008 18:41:13 +0000
Subject: Re: [RFC] Type hints (parameter and return value)
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-37111@lists.php.net to get a copy of this message
Hi!
is_* are the important functions, since they are the ones which most resemble the type hints under discussion. Up until now, anyone
Circular argument here.
implementing this in user-land would use is_int(). It makes perfect
No, you shouldn't do that - there's absolutely no reason to accept 1 and reject '1', unless you have some very rare and special circumstance. If you are using is_int for that, your code is wrong.
sense that type hints should mimic this behaviour. Not doing so would be very inconsistent, and so confusing.
Could we stop using word "consistent" to replace "I like it"? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#37111) next »