Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3698 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65237 invoked by uid 1007); 2 Aug 2003 23:00:08 -0000 Message-ID: <20030802230007.65232.qmail@pb1.pair.com> To: internals@lists.php.net References: <20030802224959.58552.qmail@pb1.pair.com> Date: Sat, 2 Aug 2003 20:00:10 -0300 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Posted-By: 200.196.104.198 Subject: Re: hook cast_object handler in userspace From: cunha17@uol.com.br ("Cristiano Duarte") 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" escreveu na mensagem news:20030802224959.58552.qmail@pb1.pair.com... > 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 > >