Re: Strict typing
| From: | Alexey Zakhlestin | Date: | Wed, 11 Aug 2010 15:03:14 +0000 |
| Subject: | Re: Strict typing | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49341@lists.php.net to get a copy of this message | ||
2010/8/11 Ryan Panning <rpanning@gmail.com>:
> Because the current syntax used for type hinting
> classes/arrays is strict. If changed, you would need to specify that scaler
> types are weak but classnames are strict and now you have a WTH moment.
Not really. Class type-hinting is not strict. The only reason why it
looks strict is, that PHP doesn't provide userland ways for
object-casting.
As far as I remember, zend-engine, underneath, actually has hook for
casting. And nothing stops us from supporting such casting with hints,
eventually.
--
Alexey Zakhlestin
http://www.milkfarmsoft.com/