Hello Shane,
Friday, September 5, 2003, 7:23:43 PM, you wrote:
> Marcus B�rger wrote:
>> Hello Sebastian,
>>
>> Friday, September 5, 2003, 5:45:13 PM, you wrote:
>>
>>
>>>George Schlossnagle wrote:
>>>
>>>>Forcing all thrown objects to be subclassed from Exception does not
>>>>feel very PHP-ish.
>>
>>
>>> In this case I think that right-ish should outweigh PHP-ish.
>>
>>
>> right-ish...well why not allow to throw integers and strings and....as in
>> other languages then?
>>
> Well, couldn't the throw mechanism check to see if the data is something
> other than an Exception class, and if so, create a new Exception class
> setting the data into it?
> try {
> throw "this is my error";
> } catch(Exception $e) { }
If all exception objects must be instances of classes derived from exception
or that class itself..well..why then specify exception. Again that is not
php style. And then converting data is a very bad idea because converting
data would use the cast facility and the cast facility might use
userfunctions and i want to avoid exceptions thrown in exception handling as
long as possible.
--
Best regards,
Marcus mailto:[EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php