Re: Bug #15328: A C-like comma operator would be useful
| From: | brad lafountain | Date: | Fri, 01 Feb 2002 18:58:42 +0000 |
| Subject: | Re: Bug #15328: A C-like comma operator would be useful | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-78793@lists.php.net to get a copy of this message | ||
--- hek@loudoun-net.com wrote:
> From: hek@loudoun-net.com
> Operating system: N/A
> PHP version: 4.1.1
> PHP Bug Type: Feature/Change Request
> Bug description: A C-like comma operator would be useful
>
> A C-like comma operator would be useful, to string together series of
> statements.
>
> Example:
>
> echo ( $precondition
> ? ( doThisAndDiscardReturnValue(),
> andDoThisAndReturnReturnValue() )
> : doSomethingElseAndReturnReturnValue() );
how about
echo ($precondition ? ( doThisAndDiscardReturnValue() &&
andDoThisAndReturnReturnValue() ) : doSomethingElseAndReturnReturnValue() );
this should work!
> --
> Edit bug report at: http://bugs.php.net/?id=15328&edit=1
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com