Re: declaring variables in PHP???
| From: | Henrik Hansen | Date: | Tue, 24 Jul 2001 08:00:25 +0000 |
| Subject: | Re: declaring variables in PHP??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59310@lists.php.net to get a copy of this message | ||
rene.moonen@oberthur.nl (René Moonen) wrote:
> Hi,
>
> I'm using PHP for a few weeks now, so you can imagine that I'm making a
> lot of typing errors...
>
> Often I make a typing error in one of the variable names ($helo instead
> of $hello or worse still $Hello instead of $hello). Since PHP does not
> care about declaring variables before using them, it is very easy to
> overlook such small typing error in a large PHP script.
>
> In the old days of ANSI C, there where things like LINT that would help
> you with these problems. Of course in ANSI C these things were easier,
> because of the fact that variables need to be declared before they could
> be used.
>
> My questions:
> 1. can you configure PHP in such away that variables need to be
> declared?
you can change your warning level to E_ALL to give you a warning when
variables aren't defined, but it still does not NEED to be defined.
> 2. are there source code checking tools that could help me locate
> problems like described above?
dont know.
--
Henrik Hansen