Re: [PHP-DEV] objects as string and arrays as string

2002-08-16 Thread Brad LaFountain
I went back and read the lists about why people don't like __to_string() or __string_value() method. the arguments were the differences in when convert_to_string vs zend_make_printable_zval were called differently. I believe andi isn't against it but wants it implemented good and zeev was all fo

Re: [PHP-DEV] objects as string and arrays as string

2002-08-16 Thread Jason T. Greene
stratification = stringification (damn spellchecker) On Fri, 2002-08-16 at 09:30, Jason T. Greene wrote: > Perl has this (it's called "stratification"), and it is quite useful. > One example is that you have an error object that contains various > properties (line location, error class, error lev

Re: [PHP-DEV] objects as string and arrays as string

2002-08-16 Thread Jason T. Greene
Perl has this (it's called "stratification"), and it is quite useful. One example is that you have an error object that contains various properties (line location, error class, error level, error code, etc). And on evaluating the object as a string, it dumps it as an easy to read error message. -

Re: [PHP-DEV] objects as string and arrays as string

2002-08-16 Thread Marcus Börger
At 15:52 16.08.2002, Brad LaFountain wrote: >I want to throw together a quick hack so that objects can implement a >__as_string() method that will get called when the string is used in a string >contex. Instead of append "Object". > >$s = (string)$object; > or >$s .= $object; > >also the same

[PHP-DEV] objects as string and arrays as string

2002-08-16 Thread Brad LaFountain
I want to throw together a quick hack so that objects can implement a __as_string() method that will get called when the string is used in a string contex. Instead of append "Object". $s = (string)$object; or $s .= $object; also the same things with arrays that will do something similar to