Re: RFC: Type hinting revisited for PHP 5.3
| From: | Stanislav Malyshev | Date: | Wed, 01 Jul 2009 19:04:16 +0000 |
| Subject: | Re: RFC: Type hinting revisited for PHP 5.3 | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44595@lists.php.net to get a copy of this message | ||
Hi!
I agree. We won't be able to use an int type for something which should take an int. That might not matter in user code, but if we cannot actually type hint internals functions then its a problem.Internal functions have types, however parameters of different types are usually converted, not rejected.
My feeling is that scalars should be automatically coerced to the correct type, if it makes sense to do so. (ie reject non-numericThat (coercion) is what internal functions do, but not what the proposed patch does (except for "numeric" hint). -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com