I know that in a dev cycle the warnings are there to help you figure out what is wrong with your code, What I am wondering is what types of warnings should you just disregard? Are there any? are there warnings that are caused due to degradation of a command in a newer version of php etc, does it matter, or is it something I should be concerned with even if the code does do what I want it to?

Recommended Answers

All 4 Replies

Member Avatar for diafol

Deprecation happens for a number of reasons. Sometimes it's down to security. If you can update the code and clear out deprecated statements/functions, why not do it? You don't want to be still coding in php4 when php6 comes out. Some deprecated functions may even be left out of future versions, so they won't work at all.

Right I get that, but Since I am on a shared server, it is not up to me which version of php I code in, its up to my server administrator -- in this case hostgator so I know they are going to keep fairly current to keep up with joomla and WP etc. However with my code, it seems I may be getting some of the warnings because of the header already sent -- not a big deal and it doesn't seem to cause any problems now or later. I also may get some warnings based off of incorrect user input Sure it could be validated a little more with javascript before its passed through, but should I worry about it, if I have fail safes programmed in that change the content after the warning is generated in the err_log.

Finally I get some mysqli warnings (these are the ones I worry about) Since I already have looked them up and my situation does not match any that I have found online, and the data still gets to where I need it to does it matter?

Member Avatar for diafol

Any warning (IMO) should be something to investigate and to try to fix. header already sent shouldn't happen though, it means that there is previous output, which may or may not point to a different error. You should ask whether the header is in the right place in your code.
The user input, if it's cleaned and validated properly should only give the errors you coded for. JS should never be depended upon to filter out wrong input anyway.

MySQLi warnings - what are they? Sounds ominous.

Well I will take a closer look at them then, the main mysqli issues are kind of a mute point because I will be re writing that entire code block soon (its an inventory transfer script) to handle scanner input. It has been running like this since last july, so another month or so probably wont hurt. I am going to mark this thread as solved. --You heard it here first kiddos, fix your warnings in php.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.