Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Andi Gutmans
The Exception class should support cast_object(). I don't see why we need to add extra flags. Andi At 11:45 PM 3/16/2004 +0100, Marcus Boerger wrote: Hello Timm, hello Andi, i htought i had a better solution to the __toString() problem. But then i found out why we made it so complex. The

Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Marcus Boerger
Hello Andi, the problem is that we have many classes that the handler table to behave mostly like a default php object. We'd need to manually set the cast handler for all of them. marcus Wednesday, March 17, 2004, 9:45:26 AM, you wrote: The Exception class should support cast_object(). I

Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Andi Gutmans
At 09:49 AM 3/17/2004 +0100, Marcus Boerger wrote: Hello Andi, the problem is that we have many classes that the handler table to behave mostly like a default php object. We'd need to manually set the cast handler for all of them. Yes, that is correct. Don't forget that cast_object() can not call

Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Andi Gutmans
Marcus and rest, Zeev and I took a long look at the whole __toString() issue. There is a problem today that make_printabl_zval() is being called in many places, some of which can't cope with a user-land __toString() being called. In order to support this we will have to do a complete

Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Hans Lellelid
Hi Andi, Quick question - Andi Gutmans wrote: Marcus and rest, Zeev and I took a long look at the whole __toString() issue. There is a problem today that make_printabl_zval() is being called in many places, some of which can't cope with a user-land __toString() being called. In order to

Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Andi Gutmans
At 11:05 AM 3/17/2004 -0500, Hans Lellelid wrote: Hi Andi, Quick question - Andi Gutmans wrote: Marcus and rest, Zeev and I took a long look at the whole __toString() issue. There is a problem today that make_printabl_zval() is being called in many places, some of which can't cope with a

Re: [PHP-DEV] Exception::__toString() not called

2004-03-17 Thread Hans Lellelid
Hi - Andi Gutmans wrote: Just to clarify, this is only for internal classes like Exception, right? Userland __toString() will continue to be invoked when an explicit (string) cast (or concat, etc.) is used, correct? Wrong. The only time userland __toString() will be invoked will be in

[PHP-DEV] Exception::__toString() not called

2004-03-16 Thread Timm Friebe
Hi, Both of the following examples used to output the Exception::__toString() output, which they don't anymore: $ php-dev -r '$e= new Exception(); echo $e, \n;' Object id #1 $ php-dev -r '$e= new Exception(); echo (string)$e, \n;' Object id #1 Works fine for userland objects: $ php-dev -r

Re: [PHP-DEV] Exception::__toString() not called

2004-03-16 Thread Marcus Boerger
Hello Timm, hello Andi, i htought i had a better solution to the __toString() problem. But then i found out why we made it so complex. The reason IIRC was to prevent __toString() being called everywhere automatically when it is a user function. Havin said this the solution is very easy. We