Re: Proposal: Array syntax

From: Date: Thu, 06 Nov 2003 12:16:11 +0000
Subject: Re: Proposal: Array syntax
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-5292@lists.php.net to get a copy of this message
Mike Robinson wrote:
Perlish or not could not be a real reason for adding or not adding a feature in PHP. The important thing here is if it fits to the language concept or not.
Indeed, and IMHO it does, much like ($a==$b)?... fits in quite well as an alternative to if ($a==$b)... It is an alternative syntax that makes things more readable and easier to use. Not an awful lot of magic, sexiness, or character savings involved.
The ternary conditional operator is not an alternative to if-then-else construct because it always evaluates to some boolean while the latter doesn't evalute to anything because it's just control of execution structure. As for discussed array syntaxes they always evaluate to the same result given the same input values. So they're equal.

« previous php.internals (#5292) next »