Sorry guys,

> $o = new xxx();
should be $o = new my_object();

And if there is a way to hook into zend_standard_class (stdClass) what would
make all objects inherit the to_string method, it would be great !

Cristiano Duarte

"Cristiano Duarte" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> Hi internals,
>
> Is there a way to hook the cast_object handler in userspace ? What I want
is
> a default "to_string" method called when I do something like:
>
> class my_object extends class_with_default_to_string_method {
>     private $value = "Hello";
>     public function to_string() { //overhiding default to_string wich
prints
> "Object id #n"
>         return $this->value;
>     }
> }
>
> $o = new my_object();
> echo $o;
>
> or:
>
> $o = new xxx();
> echo "My stringfied value is=$o";
>
> Thanx,
>
> Cristiano Duarte
>
>



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to