[PHP-DEV] Bug #14285 Updated: Forcing variable declaration

2001-11-29 Thread derick

ID: 14285
Updated by: derick
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: *General Issues
Operating System: Redhat Linux 7.2
PHP Version: 4.0.6
New Comment:

set error_reporting to E_ALL, and you'll see all undefined vars. However, it doesn't 
force the use of it.

Derick

Previous Comments:


[2001-11-29 11:17:16] [EMAIL PROTECTED]

Is there a way to make PHP force you to declare variables like option explicit in 
VBScript or use strict in Perl?  If not, will this feature become available?  While 
this is not really a bug, it might be a nice feature to have available.





Edit this bug report at http://bugs.php.net/?id=14285edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] Bug #14285 Updated: Forcing variable declaration

2001-11-29 Thread Neil Kimber

Set up an error-handler that explicitly checks for this error. If it occurs,
output to screen the error with file and line number and exit the script.

The only problem with this is if you've already started dumping HTML and the
error occurs in the middle of a tag. Any subsequent output may not be
displayed on screen.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: 29 November 2001 16:20
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] Bug #14285 Updated: Forcing variable declaration


 ID: 14285
 Updated by: derick
 Reported By: [EMAIL PROTECTED]
 Old Status: Open
 Status: Closed
 Bug Type: *General Issues
 Operating System: Redhat Linux 7.2
 PHP Version: 4.0.6
 New Comment:

 set error_reporting to E_ALL, and you'll see all undefined vars.
 However, it doesn't force the use of it.

 Derick

 Previous Comments:
 

 [2001-11-29 11:17:16] [EMAIL PROTECTED]

 Is there a way to make PHP force you to declare variables like
 option explicit in VBScript or use strict in Perl?  If not,
 will this feature become available?  While this is not really a
 bug, it might be a nice feature to have available.

 



 Edit this bug report at http://bugs.php.net/?id=14285edit=1


 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14285 Updated: Forcing variable declaration

2001-11-29 Thread hholzgra

ID: 14285
Updated by: hholzgra
Reported By: [EMAIL PROTECTED]
Old Status: Closed
Status: Open
Old Bug Type: *General Issues
Bug Type: Feature/Change Request
Operating System: Redhat Linux 7.2
PHP Version: 4.0.6
New Comment:


this would only catch read usage of undefined variables,
but not assigning values to them

see:

?php

 $typofree = hallo;

 ...

 $xtypofree = ooops;

?

nothing in PHP will warn you that you have a typo
in the second assignment, so creating a new variable
unintended


... moved to feature requests ...

Previous Comments:


[2001-11-29 11:20:18] [EMAIL PROTECTED]

set error_reporting to E_ALL, and you'll see all undefined vars. However, it doesn't 
force the use of it.

Derick



[2001-11-29 11:17:16] [EMAIL PROTECTED]

Is there a way to make PHP force you to declare variables like option explicit in 
VBScript or use strict in Perl?  If not, will this feature become available?  While 
this is not really a bug, it might be a nice feature to have available.





Edit this bug report at http://bugs.php.net/?id=14285edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]