Re: type hinting throwing a fatal error
| From: | Andi Gutmans | Date: | Mon, 08 Aug 2005 21:58:47 +0000 |
| Subject: | Re: type hinting throwing a fatal error | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-17635@lists.php.net to get a copy of this message | ||
At 11:41 PM 8/8/2005 +0200, Derick Rethans wrote:
On Mon, 8 Aug 2005, Andi Gutmans wrote: As far as implementation is concerned, it definitely should wait for after PHP 5.1 and the patch should deal with the hard parts which are internal functions and overloaded functions. Implementing this for user-functions is the easier part. There might be some gotchas (as usual) with internal functions throwing exceptions. Yeah, but afaik all cases *should* use this function 'zend_verify_arg_type', if not, that needs to be fixed.Yep, problem starts not when you identify and raise the exception but when you have to return to the engine and allow it to propogate. Andi
On a whole though, I do recommend to relax on the "add-every-oo-feature-that-exists" to the PHP code base, because it'll lead to PHP loosing its ease-of-use. The namespace proposal (which I haven't replied to yet) is a prime example. I saw all sorts of Java-like stuff like private classes which in my opinion would just over-complicate our model which already has become quite rich. We should only add what we really think PHP users need, and not stuff which is nice because it's OOpier. I do think that if we can get it right, a basic namespace model would be useful, but it all depends wether we can avoid the problems we had in the past *and* keep it simple! Right, I definitely agree there. P.S. - Derick, out of curiosity, what made you ask for an Exception? I thought you don't use OOP, and definitely not evil try/catch constructs? :) I prefer not to comment on that :) Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org