Re: Re: Using constructs like unset() in expressions like ()&&()
| From: | Richard Lynch | Date: | Fri, 17 Dec 2004 17:22:49 +0000 |
| Subject: | Re: Re: Using constructs like unset() in expressions like ()&&() | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-204603@lists.php.net to get a copy of this message | ||
Tomas Tintera wrote:
> Thanks for your answers (you probably don't understand me).
>
> I am looking for some construct (or statement or function) which allows
> to do this:
>
> <?php (True==False) or (construct_i_am_looking_for(unset($a))); ?>
>
> Note that the unset() has no return value (and so it can't be used as a
> part of other expression; it can be only used as a stand-alone
> statement), so I thing it could be good if there were some construct
> which makes expression with return value from expression with no return
> value.
>
> It is not possible to use just
> <?php (True==False) or (unset($a)); ?>
Perhaps something like this:
function my_unset($var){
global $$var;
$wasset = isset($$var);
unset($$var);
return $wasset;
}
my_unset('a'); //unset($a);
Or, in a more general way:
function forcereturn ($php){
return eval($php);
}
Damned if I understand *why* you want this, mind you. :-)
--
Like Music?
http://l-i-e.com/artists.htm