Re: [PHP4BETA] Is this a good idea for an operator?
| From: | Manuel Lemos | Date: | Tue, 03 Aug 1999 04:35:23 +0000 |
| Subject: | Re: [PHP4BETA] Is this a good idea for an operator? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3056@lists.php.net to get a copy of this message | ||
Hello Michael,
On 03-Aug-99 06:50:18, you wrote:
>> > Instead of this in PHP/C code
>> > if ($action=="modify" || $action=="create" ||
>> > $action=="delete") {
>> >
>> > have this
>> >
>> > if ($action in ("modify","create","delete")) {
>>
>> Or
>>
>> if ($action || ("modify", "create", "delete")) {
>>
>I think this is better also
>or even:
>if ($action == ("||","modify", "create", "delete")) {
>if ($action == ("&&","modify", "create",
>"delete")) {
>if ($action != ("&&","modify", "create",
>"delete")) {
Why don't you just do:
$options=array("modify"=>0, "create"=>0, "delete"=>0);
if(IsSet($options[$actions]))
{
}
This works in PHP as it is and so doesn't require new syntax.
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
--
E-mail: mlemos@acm.org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--