Re: Variable declaration
| From: | Rasmus Lerdorf | Date: | Thu, 27 Sep 2001 07:58:56 +0000 |
| Subject: | Re: Variable declaration | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68959@lists.php.net to get a copy of this message | ||
On Thu, 27 Sep 2001, it was written:
> <? error_reporting(E_ALL);
> $Test=3;
> echo $Test;
> ?>
>
> And I get no warning about $Test not being declared before (like C
> declaration).
>
> Any1 has an example about forcing variable declaration?
What do you mean force declaration? That's what you are doing with this
line:
$Test = 3;
This declares $Test to be an integer with the value 3. Assignment and
declaration is done in one step. There is no mechanism to do it in two.
-Rasmus