Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27084 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20876 invoked by uid 1010); 19 Dec 2006 08:22:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20861 invoked from network); 19 Dec 2006 08:22:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2006 08:22:42 -0000 Authentication-Results: pb1.pair.com header.from=manchokapitancho@gmail.com; sender-id=pass; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=manchokapitancho@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.170 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: manchokapitancho@gmail.com X-Host-Fingerprint: 66.249.92.170 ug-out-1314.google.com Linux 2.4/2.6 Received: from [66.249.92.170] ([66.249.92.170:44345] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/B6-14401-F21A7854 for ; Tue, 19 Dec 2006 03:22:42 -0500 Received: by ug-out-1314.google.com with SMTP id 71so1922688ugh for ; Tue, 19 Dec 2006 00:22:05 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=h4TCWAqlxOHqwhdfRkhWWW0TkPviqQKIKywylekhduendFyxjP3dHRCnXyw+utAEKUqIFEjaunVEK4UPdfxRMuIePjUkGxuo+hz9gmkaMFOlSB7Li74sjLHUykahcq//8kl3EZ/VyEnlq0sVjQOucj6nPUgb2T1nnXEduOGPojQ= Received: by 10.82.184.2 with SMTP id h2mr815241buf.1166516525050; Tue, 19 Dec 2006 00:22:05 -0800 (PST) Received: by 10.82.186.17 with HTTP; Tue, 19 Dec 2006 00:22:04 -0800 (PST) Message-ID: Date: Tue, 19 Dec 2006 10:22:05 +0200 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_898_17876668.1166516525007" Subject: __toString extension proposal From: manchokapitancho@gmail.com ("Marian Kostadinov") ------=_Part_898_17876668.1166516525007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, there is one issue that I experience since I started using 5.2.0 and especially the new correct __toString behaviour. Generally it works fine. But sometimes I find it useful to get __toString return another object the also has a __toString method. So my idea is - is it possible (and good idea) to make it work in this extended manner. Here is an example to illustrate what I mean: class test1 { function __toString() { return 'i am class 1'; } } class test2 { function __toString() { return new test1; } } $test = new test2; echo $test; ------=_Part_898_17876668.1166516525007--