What are some things I need to pay attention to to be sure my programs are ok for php strict mode? I am only working on a shared server and I don't really have a way to test it in strict myself.
In the past I think someone said to have all error reporting on and then fix whatever shows up. Is it as simple as that? In most cases they said that the error would be that something isn't defined and that I need to use isset() in my if statements to avoid those errors.
PHP Strict
Started by BASHERS33, Apr 19 2009 02:59 PM
4 replies to this topic
#1
Posted 19 April 2009 - 02:59 PM
|
|
|
#2
Posted 25 April 2009 - 04:08 PM
As you were told, make sure you have your error debugging on. Yes, most errors are as simple as forgetting to specify something or what not. Just make sure you have your error reporting on, and you should be good to go.
#3
Posted 01 May 2009 - 01:02 PM
$start = $this->request['st'] ? intval($this->request['st']) : 0;
That is an exact example from the forum software itself which I simply copied when needed in my modification. But it causes a notice that "st is undefined". I thought that first part is equivalent to isset() which wouldn't cause any sort of error or notice or whatever. Are they misformatting that? Do I need to put isset() around the first part?
I think I fixed all other issues, but the forum software ITSELF has tons of notices. Does strict mess up if there is any error, notice, etc... at all? If so then their own software won't be working in strict mode either.
Edited by Jaan, 02 May 2009 - 01:58 AM.
Please use code tags when you're posting your codes!
#4
Posted 02 May 2009 - 11:37 AM
Quote
I thought that first part is equivalent to isset()
#5
Posted 02 May 2009 - 12:57 PM
Thanks. I should have just tried it with isset before asking. Blah.
What happens in strict mode if there are notices? Does it then not work or does it simply show the notices or what?
Now I see no other issues, but I know there will be some hidden cases that could crop up. But with the Invision software itself having tons and TONS of notices, I don't know why I even bothered getting rid of my own. Guess better to do thigns right even if the software it's revolving around has some loose ends though.
What happens in strict mode if there are notices? Does it then not work or does it simply show the notices or what?
Now I see no other issues, but I know there will be some hidden cases that could crop up. But with the Invision software itself having tons and TONS of notices, I don't know why I even bothered getting rid of my own. Guess better to do thigns right even if the software it's revolving around has some loose ends though.


Sign In
Create Account


Back to top









