faqts : Computers : Programming : Languages : PHP : kms : General

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

42 of 46 people (91%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

Can I make PHP force me to declare variables before using them?
Does PHP have an equivalent to Visual Basic's 'option explicit' command?

Feb 2nd, 2000 01:08
Nathan Wallace, Torben Wilson


There is no way to force this, but you can user error_reporting() (
i.e. error_reporting( E_ALL ); ) to have PHP issue a warning every
time you reference an undefined variable.