Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3697 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58554 invoked by uid 1007); 2 Aug 2003 22:49:59 -0000 Message-ID: <20030802224959.58552.qmail@pb1.pair.com> To: internals@lists.php.net Date: Sat, 2 Aug 2003 19:50:01 -0300 Lines: 26 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: PHP5: hook cast_object handler in userspace From: cunha17@uol.com.br ("Cristiano Duarte") 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