Re: Require variable declaration?
| From: | Rasmus Lerdorf | Date: | Wed, 27 Mar 2002 21:00:40 +0000 |
| Subject: | Re: Require variable declaration? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90424@lists.php.net to get a copy of this message | ||
No, but simply up your error reporting level to E_ALL and you will get
warnings if you use an uninitialized variable which should take care of
such typos for you.
-Rasmus
On Wed, 27 Mar 2002, Kjell Hansen wrote:
> That's too bad,
> I used to do some ASP which is weakly typed too but I still could use "Option
> Explicit" to require variables to be declared.
> Then a small typo would produce very hard-to-find errors.
>
> Well, I guess I have to live with it. Can I add it to a PHP5-wishlist?
>
> Thanx
> /Kjell
>
> ----- Original Message -----
> From: "Rick Emery" <remery@excel.com>
> To: "'Kjell Hansen'" <kjell.hansen@telia.com>;
> <php-general@lists.php.net>
> Sent: Wednesday, March 27, 2002 10:45 PM
> Subject: RE: [PHP] Require variable declaration?
>
>
> > PHP is weakly typed. Therefore, definitions are not needed. A variable may
> > assume any guise depending upon its context.
> >
> > -----Original Message-----
> > From: Kjell Hansen [mailto:kjell.hansen@telia.com]
> > Sent: Wednesday, March 27, 2002 2:47 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] Require variable declaration?
> >
> >
> > Hi,
> > I've just started making my database/PHP-scripts and I'm used to, from
> > my earlier development, have my variables declared at the top of each
> > routine.
> > But I can't find the command that would force me to declare my variables
> > and I can't find the declare statement either.
> >
> > Is there a way to do this?
> >
> > Regards
> > /Kjell
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>