Evaluating an idea based on it's syntactic similarities to other languages is
complete and utter nonsense. It has nothing to with being like language Xyz. It
has to do with familiarity to language constructs. One already understands the
idea of 'this || that'. It's certainly doesn't take a stretch of the imagination
to assume that at least a beginner programmer will believe that '$a = $this ||
$that;' would return one of the two values (as opposed to the boolean it now
returns). The point is, I don't have to look up in the documentation what '||'
means, or '? :' means... or (hypothetically) what '||=' means. They are concepts
that are easy to understand and, more importantly, easy to remember.
If this concept is turned into a function, it'll be another in a long list of
functions for PHP that are difficult to remember for either their name (issetor?
ifsetor? ifset?) or the order of arguments thereof (ie. array and string
handling functions).
Sebastian wrote:
Wow, it'll be just like perl! this is so great.
On 10/28/05, James Crumpton <[EMAIL PROTECTED]> wrote:
Andi Gutmans wrote:
> I don't think it's a matter of giving the engine a try. I think we first need
> to make a decision what the best way to go is and then we can discuss
> implementation if/what is possible. Once 5.0.0 is out I'm going to have more
> time look into this.
What's the word on this?
Some of the names given were:
issetor
ifsetor
ifset
ifnull
coalesce
I'm actually kind of partial to:
$a = $foo || $bar;
$a = $foo || $bar || $xyz || $etc;
Or better yet (or maybe in addition too):
$a['foo'] ||= 'bar'; // if set do nothing, otherwise assign 'bar'
-james
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
--
-------------
[EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php