What is the recommended error_reporting() setting for development? What about E_STRICT?

前端 未结 8 1565
醉梦人生
醉梦人生 2020-12-06 04:29

Typically I use E_ALL to see anything that PHP might say about my code to try and improve it.

I just noticed a error constant E_STRICT, but

8条回答
  •  萌比男神i
    2020-12-06 04:40

    Depending on your long term support plans for this code, debugging with E_STRICT enabled may help your code to continue working in the distant future, but it is probably overkill for day-to-day use. There are two important things about E_STRICT to keep in mind:

    1. Per the manual, most E_STRICT errors are generated at compile time, not runtime. If you are increasing the error level to E_ALL within your code (and not via php.ini), you may never see E_STRICT errors anyway.
    2. E_STRICT is contained within E_ALL under PHP 6, but not under PHP 5. If you upgrade your server to PHP6, and have E_ALL configured as described in #1 above, you will begin to see E_STRICT errors without requiring any additional changes on your part.

提交回复
热议问题