Assignment operator proposal
| From: | Bogdan Stancescu | Date: | Wed, 20 Mar 2002 22:36:26 +0000 |
| Subject: | Assignment operator proposal | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-89426@lists.php.net to get a copy of this message | ||
Hi all!
I'd like to hear from a single one of you who isn't tired of code similar to
<?
if (!$whatever) {
$whatever=something;
}
?>
or else
<?
if ($whatever)
{
$somethingelse=$whatever;
}
?>
How about a new asignment operator which would shut up all those Python enthusiasts - let's say the new operator would be caret - and we could replace the first example with
<?
$whatever^=something;
?>
and the second example with
<?
$somethingelse=^$whatever;
?>
What's more, we could also have
<?
$yetanother^=^$anything;
?>
which would assign $anything to $yetanother if and only if both are note null.
What do you think?
Bogdan Stancescu