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 print/

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 user-l

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 suppo

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 restructur

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 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 don'

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 reason

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

2004-03-16 Thread Marcus Boerger
> Hello Timm, hello Andi, well i forgot to mentione a problem description: Some internal classes copy the standard handler table. And hence their cast handler is set to NULL. This we need to avoid. But still standard objects may not be converted to strings everywhere. > i htought i had a better s

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 expand

[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