Re: Re: Syntactic improvement to array

From: Date: Mon, 05 Feb 2007 23:46:03 +0000
Subject: Re: Re: Syntactic improvement to array
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-27839@lists.php.net to get a copy of this message
On Mon, February 5, 2007 12:05 pm, Stanislav Malyshev wrote: >> So now we have an invisible operator with a magical symbol '[' which >> *sometimes* means create an array, but *sometimes* means to >> de-construct an array into individual variables? > > Yep. We also have an invisible magical operator (), which sometimes > means function definition, sometimes means expression grouping, > sometimes means delimiter, sometimes means function call and sometimes > means regular expression grouping. How do we manage? ;) How you manage is that a zillion newbies use: include("foo.inc"); echo("foo.inc"); and they don't even realize that the () doesn't mean what they think it means, and it "just works" because it's a no-op. *THAT* is harder to explain than just about anything in PHP syntax. How many newbies will be trying: array[1, 2, 3]; and left scratching their heads when it doesn't work? -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.internals (#27839) next »