Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5930 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63270 invoked by uid 1010); 1 Dec 2003 18:53:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63246 invoked by uid 1007); 1 Dec 2003 18:53:13 -0000 To: internals@lists.php.net, Andi Gutmans Message-ID: <3FCB8E18.8010802@cschneid.com> Date: Mon, 01 Dec 2003 19:53:12 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030626 X-Accept-Language: de-ch, en-us, en MIME-Version: 1.0 References: <5.1.0.14.2.20031201194023.0334ab98@127.0.0.1> In-Reply-To: <5.1.0.14.2.20031201194023.0334ab98@127.0.0.1> X-Enigmail-Version: 0.76.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 195.226.9.103 Subject: Re: Summary of string conversion problem From: cschneid@cschneid.com (Christian Schneider) I'm not really sure on what's the best way to handle the string conversion problem, as I haven't worked with SimpleXML yet. Andi's examples on the other hand aren't convincing enough for me so here my comments: Andi Gutmans wrote: > a) include $obj; will not error out but convert the object to a string > and then include it. I'd expect that in most cases this would be an invalid filename which would result in an error message. Nothing lost there. > b) $obj[2] = 3; (where $obj implements a __toString function) isn't > quite defined anymore. Should this work? The bracket syntax has been deprecated in PHP4 already. Giving a warning on a high error reporting level seems do the job for me. > c) $arr[$obj] would suddenly work according the __toString(). I remember this being requested as a feature anyway ;-) > go and the way Java chose too (not that I thnk we necessarily need to go > the same way but there were some smart ppl who thought of these issues > before us). I don't like Java being used for PHP design decisions really. The syntax is cumbersome and has a different focus (static type checking). Don't forget that a lot of design decisions for Java were made in the 80s. My $.2, - Chris