-5

I am a php newb and I don't have a clear answer for this.

To what extent do PHP "Notice" errors affect load time?

Ty

4

3 回答 3

1

The notice usually is logged to a file, so it involves I/O activity. In the worst case scenario however, the file will just consume the entire free space at HDD which effectivly will block your web site. Other than this, the performance decrease is usually negligible - there are a lot of things that are becoming bottleneck sooner than the notices.

于 2012-10-17T14:25:23.373 回答
0

好吧,通知被吐到页面上会导致更多的数据被发送到客户端的浏览器。因此,它可能会增加访问者的加载时间。例如,如果您有通知发生在一个大循环中,这可能会添加大量不需要的数据。

在服务器端,我怀疑一些简单的 I/O 日志记录会导致任何明显的影响,除非您获得大量流量。

最后 - 通知通常表明某些事情并不安静......导致这些通知的问题是否会导致更长的加载时间是任何人的猜测。

于 2012-10-17T14:29:02.213 回答
0

它们不会以任何有意义的方式影响加载时间。

然而:

  1. 那里有通知警告您潜在的不良编码实践和/或可能的错误。您应该编写代码以避免导致它们。

  2. 在生产网站上,您应该禁用错误消息输出——不是因为任何性能问题,而仅仅是因为在您的网站上显示错误看起来不是很专业,并且可能会给黑客提供有关如何攻击您的系统的线索。

于 2012-10-17T14:26:49.983 回答