Re: Type hinting

From: Date: Fri, 28 May 2010 06:54:55 +0000
Subject: Re: Type hinting
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.internals 
Request: Send a blank email to internals+get-48540@lists.php.net to get a copy of this message
At 08:28 28/05/2010, Tjerk Anne Meesters wrote:
On the other hand, auto-casting used to be my favourite until I glanced over the conversion table; it's not just regular casting, it has different rules. I wouldn't want to be the one going over that table when writing code against a certain API, I should only need to see the documentation.
Tjerk, I think you have a nice idea about E_STRICT, except it makes much more sense with auto-conversion. That is - in case of 'fail' - we'd still convert, and emit E_STRICT (or E_NOTICE). That means that the API developer will always get the type he expects, while the user will be guided in the right direction in a friendly PHPish manner. The conversion table is up for discussion, BTW. If most people prefer that it's more similar to PHP's existing auto-conversion rules (that appears to be the case) we can certainly do that. Zeev

« previous php.internals (#48540) next »