PHP 5.3.X中的非确定性对象引用错误 [英] Non-deterministic object reference bug in PHP 5.3.X
问题描述
截至昨天(也许在最近的PHP更新之后?),我在php 5.3.3中遇到了一些非常奇怪的不确定性错误.这些也出现在我们的PHP 5.3.2生产服务器中.
在代码库的各个部分中,错误基本上等于Fatal error: Uncaught exception 'ErrorException' with message 'Attempt to assign property of non-object'
.通常,错误行类似于:__construct()
调用中的$this->foo = $bar
.
$this
?!
我不知道发生了什么.有任何想法吗?这可能是该错误的回归吗?: http://bugs.php.net/31525 >
编辑:我要提一下,稍等一会儿就刷新脚本,而且完全无需更改代码,就可以再次使用该脚本.因此不确定.
编辑2 :此外,虽然PHP设置为记录甚至最小的错误,并且 记录发生的其他错误,但该错误不会记录在日志文件.这使我认为我们正在查看一个PHP引擎依赖项错误.
好吧,这似乎是一个错误...
- 其实例在Zend_Config中发生
- 与symfony可能相关的问题
- 还有其他一些(搜索它是毫无用处的,因为很多站点都抛出该错误.因此,很难将有效实例与一般性错误区分开来)
以下是一些相关的错误报告:
As of yesterday (perhaps after a recent PHP update?), I'm getting some very strange non-deterministic bugs in php 5.3.3. These appear in our production server in PHP 5.3.2 as well.
The errors essentially amount to Fatal error: Uncaught exception 'ErrorException' with message 'Attempt to assign property of non-object'
in various parts of the code base. Generally, the error line is something like: $this->foo = $bar
in a __construct()
call.
$this
is not found in the constructor?!
I have no idea what is going on. Any ideas? Is this possibly a regression of this bug?: http://bugs.php.net/31525
Edit: I should mention, refreshing the script after a little while, with absolutely no changes to the code, makes it work again. Hence non-deterministic.
Edit 2: Furthermore, while PHP is set to log even the tiniest of errors, and is logging other errors as they occur, this error is not logged in the log file. This brings me to think we are looking at a PHP engine dependency error.
Well, it looks to be a bug...
- An instance of it happening with Zend_Config
- A possibly related issue with symfony
- And a few others (Searching for it is pretty useless since a fair number of sites throw that error. So it's hard to discern valid instances from generic errors)
Here's some relevant bug reports:
这篇关于PHP 5.3.X中的非确定性对象引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!