PHP 4.0 Bug #9765: syntax request
| From: | fabiankessler at usa dot net | Date: | Thu, 15 Mar 2001 14:48:30 +0000 |
| Subject: | PHP 4.0 Bug #9765: syntax request | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-48988@lists.php.net to get a copy of this message | ||
From: fabiankessler@usa.net
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