Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

PHP has always warned about this since version 5.6 - if not earlier.

To stop the warnings, configuration would need to be changed in PHP config, or those warnings be silenced by the developer.

Any decent webapp has had this issues resolved a long time ago.

I would suggest that websites that will be effected probably will not migrate to PHP 8 that quickly.



True. I always turned it on while developing. This saved me from a lot of buggy code.

But there are a million questions on the internet about this 'error'. And the answer is almost always: turn the errors off.

And I believe this is the biggest problem with PHP. A lot of inexperienced users with questions that get very bad answers.


"Turn display_errors off" is a good answer for a production website. You will get problems with headers and cookies, if notices are printed before headers are sent. You might also divulge information about your stack to users.

For a development and staging website you do want notices and warnings displayed. For a production website possibly only when testing something.


> For a development and staging website you do want notices and warnings displayed.

Just SSH in and tail the log. Dealing with unexpected output from errors clobbering your headers isn't worth the trouble.

You can also try something like FirePHP [0] if you need the errors in the context of the current page.

[0]: http://www.firephp.org/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: