RE: [PHP] Re: ramble was [PHP] Not sure of my error
| From: | Joao Prado Maia | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | RE: [PHP] Re: ramble was [PHP] Not sure of my error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26002@lists.php.net to get a copy of this message | ||
On Fri, 17 Nov 2000, jeremy brand wrote:
> I guess, the issue seems to be when variables are undeclared and then
> you check them.
>
> I often never have these problems (on purpose) because when I am
> afraid that I will run into a situation like this, I declare my
> variable ahead of time to a default value. Nothing like being
> absolutely sure, and this guarantees is. I guess this just comes from
> my C days.
>
> In my opinion, if you don't want to have errors on undeclared
> variables, then the only way to be sure you are not going to get
> errors is to declare them!
What about just checking with
if (isset($foo)) {
if (!$foo)
echo "nothing here";
}
Joao