Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20142 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49880 invoked by uid 1010); 18 Nov 2005 12:42:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49854 invoked from network); 18 Nov 2005 12:42:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2005 12:42:51 -0000 X-Host-Fingerprint: 160.9.128.17 dns2.lmu.ac.uk Received: from ([160.9.128.17:25157] helo=mrelay-b.lmu.ac.uk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 35/0E-07637-94CCD734 for ; Fri, 18 Nov 2005 07:42:49 -0500 Received: from localhost.lmu.ac.uk ([127.0.0.1] helo=localhost) by mrelay-b.lmu.ac.uk with esmtp (Exim 4.43) id 1Ed5WT-0004Fx-FM for internals@lists.php.net; Fri, 18 Nov 2005 12:39:21 +0000 Received: from mrelay-b.lmu.ac.uk ([127.0.0.1]) by localhost (mrelay-b [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15194-04 for ; Fri, 18 Nov 2005 12:39:19 +0000 (GMT) Received: from leedsmet-exch1.leedsmet.ac.uk ([160.9.35.117]) by mrelay-b.lmu.ac.uk with esmtp (Exim 4.43) id 1Ed5VR-0004FE-Mj for internals@lists.php.net; Fri, 18 Nov 2005 12:38:17 +0000 x-mimeole: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 18 Nov 2005 12:38:47 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] dropping curly braces Thread-Index: AcXsNeTJ6sFjeaOcRy+/UwHknj3pZgABh1DQ To: X-Virus-Scanned: by McAfee at Leeds Metropolitan University Subject: RE: [PHP-DEV] dropping curly braces From: M.Ford@leedsmet.ac.uk ("Ford, Mike") On 18 November 2005 11:48, Derick Rethans wrote: > On Fri, 18 Nov 2005, Andreas Korthaus wrote: >=20 > > Derick Rethans wrote: > >=20 > > > > That's the problem - also grep does not know if [] is used for > > > > arrays or stings. That's the same for programmers, it's often > > > > not easy to conclude from context - that's my point. > > >=20 > > > grep won't, but php -l will. > >=20 > > That's true. But what about "reducing complexity"? > >=20 > > Don't you think it's useful to allow a convention like {} for > > strings and [] for arrays, so you can be sure what $str{1} means > > without looking at any context? >=20 > No. Why not? If users demand it, why not allow them that facility? I think the visual difference between [] for arrays and {} for string acces= s is a superb feature of PHP. (Personally, I'd like to see it extended to = something like $s{2:5} or $s{2,3} for longer substrings, but I've proposed = that before and been shot down so I won't mention it ;) If {} for string access goes away, I won't be converting to [] becasue I th= ink a visual difference is vital -- so all my $s{$x} will be turned into su= bstr($s, $x, 1). Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211=20 To view the terms under which this email is distributed, please go to http:= //disclaimer.leedsmet.ac.uk/email.htm