From:             [EMAIL PROTECTED]
Operating system: all
PHP version:      4.0.4
PHP Bug Type:     Feature/Change Request
Bug description:  syntax request

such a syntax would be nice:

if (getColor() == ['green'|'blue']) {
if (someFunction() != [true&null]) {
if (xy() >= [$x&$y]) {

which means

if ((getColor() == 'green') || (getColor() == 'blue')) {
but saves one call to the function
or

$myCol = getColor();
if (($myCol == 'green') || ($myCol == 'blue')) {
but looks better and saves a temp var.

$tmp = functionThatReturnsBool();
if ($tmp == true OR $tmp == null) {

sometimes it could be done with
if (in_array(getColor(), array('green', 'blue'))) { 
but not always.

fab



-- 
Edit Bug report at: http://bugs.php.net/?id=9765&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to