Re: PEAR's Error Handling and PHP5
| From: | Lukas Smith | Date: | Wed, 21 Jun 2006 16:16:54 +0000 |
| Subject: | Re: PEAR's Error Handling and PHP5 | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43059@lists.php.net to get a copy of this message | ||
Hans Lellelid wrote:
Either way, though, the problem I see with proxy classes in PHP is that they are not very seamless: 1) you cannot use instanceof (as you note) or any of the class introspection functions; 2) you cannot use type hints; and 3) proxied classes can't make use of the SPL interfaces. I'm sure there are other problems too, but that already cuts out a fair number of the new PHP5 OO features. Since we're only talking about PHP5point taken. so it seems to me that the following is the way to go then: - mandate the use of PEAR_Exceptions or boolean returns - do not mandate that these exceptions have to be thrown, they can just as well be returned to provide context information => its at the developer discretion to decide if the situation is really "exceptional" or not that of course means that any package that does throw exceptions becomes fairly problematic to people who also develop in the same style as i do. but exceptions is what the vocal masses clamor for. so if there are unvocal masses that disagree i think they failed to make their voices heard in time. therefore they will have to change their ways or ought to go elsewhere for their libraries in the future - you know now that happy rapid prototyping land we had back in the php4 days ;) regards, Lukas