Re: [PHP] Variable name declarations?

2001-07-15 Thread teo
Hi Kent! On Sat, 14 Jul 2001, Kent Sandvik wrote: > > > function sum_array( $input_array ) > > { > > var $index; > > var $sum = 0; > > > > for( $index = 0; $index < count( $input_array ); $index++ ) > > $sum += $input_array[ $index ]; > > > > return $sum; > > } > > The a

RE: [PHP] Variable name declarations?

2001-07-14 Thread Kent Sandvik
> function sum_array( $input_array ) > { > var $index; > var $sum = 0; > > for( $index = 0; $index < count( $input_array ); $index++ ) > $sum += $input_array[ $index ]; > > return $sum; > } The array variable issue has indeed bitten me a couple of times, so now all my arr

Re: [PHP] Variable name declarations?

2001-07-13 Thread Rasmus Lerdorf
> Does anyone else have any thoughts on this? error_reporting = E_ALL in your php.ini file and PHP will warn you whenever you use an unitialized variable. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

RE: [PHP] Variable name declarations?

2001-07-13 Thread scott [gts]
> -Original Message- > From: Matthew Aznoe [mailto:[EMAIL PROTECTED]] > Subject: [PHP] Variable name declarations? > > However, I do have one complaint about PHP that seems to have a tendency to > bite me far too often, and that is the lack of variable declaration.

Re: [PHP] Variable name declarations?

2001-07-13 Thread Zak Greant
Hi Matthew, Set your error_reporting level to E_ALL. The parser will then report the use of undeclared variables. --zak - Original Message - From: "Matthew Aznoe" <[EMAIL PROTECTED]> To: "php" <[EMAIL PROTECTED]> Sent: Friday, July 13, 2001 2:22

[PHP] Variable name declarations?

2001-07-13 Thread Matthew Aznoe
I have to agree that strong typing is not a good fit with PHP. It really limits the flexibility of the language that is, at least to me, one it its strongest appeals. Often, strong typing can be overly restrictive, and free typing, when combined with good comments and documentation which shoul