Non-deterministic object reference bug in PHP 5.3.X

情到浓时终转凉″ 提交于 2019-12-18 05:05:15

问题


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.


回答1:


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:

  • 52083
  • 50027


来源:https://stackoverflow.com/questions/4188125/non-deterministic-object-reference-bug-in-php-5-3-x

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!