I would agree that performance-wise, there may be little difference in how fast a 
script runs. And
for pre-defining variables, sure you can get away without doing that and php will 
happily help you
out. However, I find it easier to debug my code knowing whether or not I remembered to 
assign a
value to my variable and where the heck it got assigned from. :-)

I would also like to point out that the combo of not registering globals and having 
all errors
reported will ensure you get the right data type when using the same variable names 
for _POST,
_SESSION, et cetera data. I had a few scripts that behaved differently than I though 
because I was
looking for the value of $foo and not realizing that my $foo was grabbing my session 
data instead of
what I thought I was assigning it to. I changed my php.ini and now I tear out far less 
hair this way

# Nathan

----- Original Message -----
From: "Maxim Maletsky (PHPBeginner.com)" <[EMAIL PROTECTED]>
Sent: Thursday, April 25, 2002 12:18 PM
Subject: RE: [PHP] Parse Error - Help? (AGAIN)

You know, I once said the same: better fix the notices and keep the code
"clean". But as I've done several performance tests I came to a
conclusion that there's no much difference debugging the code yourself
or let PHP doing it. Often predefining manually a variable resulted to
me being even more 'expensive' then when PHP debugs it. I think it is
wise using this feature of PHP. The only reason not to is for having the
full control of your code.

Just my 2 Eurocents


Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins

> -----Original Message-----
> From: Nathan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 7:15 PM
> To: PHP
> Subject: Re: [PHP] Parse Error - Help? (AGAIN)
> I'll second that one... always better to code with register_globals =
Off and E_ALL
> reporting level
> # Nathan

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to