Monkuar Posted February 6, 2012 Share Posted February 6, 2012 Let's say I have a forum with 300 active people posting 24/7 I have error reporting turned off. But if I turn it on, it shows 100-200 Undefined variable's error's on each forum page, even if it's off does it effect performance or does it matter if the php is writing to a error_log? If so how can I disable php writing to a error_log as I have no sense or no need for it. Thanks, and would the speed be noticable if I went ahead and fixed all the errors, if it would help? or no I code fine, it's just i dont use the isset.. Quote Link to comment https://forums.phpfreaks.com/topic/256520-undefined-variable-will-slow-php-or-no/ Share on other sites More sharing options...
trq Posted February 6, 2012 Share Posted February 6, 2012 Yes it makes a difference, even if your not writing to a log file. I code fine, it's just i dont use the isset.. Then you don't code well. Fix your code. Quote Link to comment https://forums.phpfreaks.com/topic/256520-undefined-variable-will-slow-php-or-no/#findComment-1315048 Share on other sites More sharing options...
PFMaBiSmAd Posted February 6, 2012 Share Posted February 6, 2012 The reporting/display/logging of the error message is just the last step in the error handling code that php executes every time it encounters an error every time your code runs. The reason you would want to find and fix the cause of any php produced error message is so that only real errors will be reported and displayed/logged, so that you will know when a legitimate visitor did something that your logic did not take into account or a hacker is trying (did) break into your script and how he did it, so that you can find and fix the problem. If you are getting 100's of errors, producing a gigabyte size error log file, you are definitely not coding fine. Quote Link to comment https://forums.phpfreaks.com/topic/256520-undefined-variable-will-slow-php-or-no/#findComment-1315067 Share on other sites More sharing options...
Monkuar Posted February 6, 2012 Author Share Posted February 6, 2012 The reporting/display/logging of the error message is just the last step in the error handling code that php executes every time it encounters an error every time your code runs. The reason you would want to find and fix the cause of any php produced error message is so that only real errors will be reported and displayed/logged, so that you will know when a legitimate visitor did something that your logic did not take into account or a hacker is trying (did) break into your script and how he did it, so that you can find and fix the problem. If you are getting 100's of errors, producing a gigabyte size error log file, you are definitely not coding fine. Well then it's time to fix them, I guess I thought I was right? But atleast I know now right? I mean we all start somewhere? I am going to have to spend prob days going through each file and fixing each undefined $_GET and just pretty much add a isset to all the undefined's? Check out this article: http://stackoverflow.com/questions/1868874/does-php-run-faster-without-warnings You can save alot of ms's by just fixing your files, lol (found out this article after I posted here cause I was so curious) this sucks tho, i got literlaly hundrends ...... ON each file, i got like 50 files lol this gonna take forever..... Also, one of my errors are this line: $DB->obj['debug'] = ($INFO['sql_debug'] == 1) ? $_GET['debug'] : 0; It's a terny operator? I see nothing wrong with it? Quote Link to comment https://forums.phpfreaks.com/topic/256520-undefined-variable-will-slow-php-or-no/#findComment-1315146 Share on other sites More sharing options...
Monkuar Posted February 6, 2012 Author Share Posted February 6, 2012 I am going ahead and fixing all my variables that get that error with isset( around the variables this should fix it up right? Quote Link to comment https://forums.phpfreaks.com/topic/256520-undefined-variable-will-slow-php-or-no/#findComment-1315162 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.