SirChick Posted September 1, 2007 Share Posted September 1, 2007 <b>Notice</b>: Undefined index: HouseType in <b>C:\xampp\htdocs\homeloginvariables.php</b> on line <b>37</b><br /> Was wondering if this "needs" to be corrected? Its worked fine without me actually doing anything about it... is a problem going to arise in future if i dont do anything about it ? Quote Link to comment https://forums.phpfreaks.com/topic/67518-this-a-necessary-fix/ Share on other sites More sharing options...
Fadion Posted September 1, 2007 Share Posted September 1, 2007 It may come from an undefined array key, but i may be wrong. Anyway errors need to be corrected. Quote Link to comment https://forums.phpfreaks.com/topic/67518-this-a-necessary-fix/#findComment-339017 Share on other sites More sharing options...
MadTechie Posted September 1, 2007 Share Posted September 1, 2007 NOTICE messages will warn you about possible bugs in your code. For example, use of unassigned values is warned. It is extremely useful to find typos and to save time for debugging. NOTICE messages will warn you about bad style. For example, $arr[item] is better to be written as $arr['item'] since PHP tries to treat "item" as constant. If it is not a constant, PHP assumes it is a string index for the array. Quote Link to comment https://forums.phpfreaks.com/topic/67518-this-a-necessary-fix/#findComment-339018 Share on other sites More sharing options...
SirChick Posted September 1, 2007 Author Share Posted September 1, 2007 Crikey, i better get to work its given me about 100 of them about different stuff! Quote Link to comment https://forums.phpfreaks.com/topic/67518-this-a-necessary-fix/#findComment-339020 Share on other sites More sharing options...
Guest Posted September 1, 2007 Share Posted September 1, 2007 Well, there are different schools of thought about this. Some believe, if it works, no need to fix it. After all, Notice errors are Notices, they aren't fatal or serious. By just turning off error reporting, problem solved. However, another school of thought may suggest that this is bad practice, and a foundation for unpredictable problems later down the road (this is my belief as well)--ideally, you should prepare for errors at every possible turn and have a fallback in case it occurs, even for notice level errors. While it is solely up to you which school you prefer, I'd recommend the stricter route. Quote Link to comment https://forums.phpfreaks.com/topic/67518-this-a-necessary-fix/#findComment-339035 Share on other sites More sharing options...
Fadion Posted September 1, 2007 Share Posted September 1, 2007 It would have different "schools" of thought if we were talking about different approaches to a problem. Actually we are talking about script errors, bugs which shouldnt be ignored, even if they dont affect the general script. As u recommended about the stricter rule, it should be a practice for all programers. Actually, those who think "if it works, no need to fix it" are lazy, not very pationate about scripting or just newbies who just want to get the script done. Quote Link to comment https://forums.phpfreaks.com/topic/67518-this-a-necessary-fix/#findComment-339040 Share on other sites More sharing options...
Guest Posted September 1, 2007 Share Posted September 1, 2007 Definately, I agree completely. But it's good to know both the sides to the coin, no? Quote Link to comment https://forums.phpfreaks.com/topic/67518-this-a-necessary-fix/#findComment-339048 Share on other sites More sharing options...
Fadion Posted September 1, 2007 Share Posted September 1, 2007 In general yes, but in programming when getting used to the better side, dont ever touch the other one Quote Link to comment https://forums.phpfreaks.com/topic/67518-this-a-necessary-fix/#findComment-339053 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.