[Update 18.01.14] This question was marked a duplicate of Intermittent PHP Abstract Class Error . However, they are different in much of the bug appearance as follows.
- That link only have
contains x abstract methoderror. But mine have more types, and the errors are more weird (see the errors below, even containing some control characters). - In that link, the questioner said disabling
opcachewill make it happen less frequently. But in my case I did never enable the opcache but these bugs happened.
[/Update]
I am using Apache, PHP, Laravel to develop my web backend. But several times a day, errors will occur saying some php built-in functions are undefined, but at other time when it is not mad, these functions are obviously defined and work well. (So it is not because I call something really undefined!)
There are even stranger things. The "undefined" things can be a php function, system constant, or even some strange strings which look like regex, or even control characters in ASCII! The examples are as follows.
Declaration of PDO::() should be compatible with PDO::?)[CHAR1][CHAR2]where the[CHAR1]and[CHAR2]areSOHandETXin ASCII.Call to undefined method #^\\{\\w+\\}#::format()Call to undefined method DateTime::format()Undefined class constant 'PDO::ERRMODE_EXCEPTION'- (Other types of errors)
Class Doctrine\DBAL\Driver\PDOStatement contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Doctrine\DBAL\Driver\Statement::errorInfo, Doctrine\DBAL\Driver\ResultStatement::closeCursor)
Here are some more information: It usually happens every several hours, but can happen in half an hour or do not happen for half a day. My server handles about 1 http GET or POST request every second from one of the 6 remote machines.
This annoys me for a very long time and I would appreciate it if anyone could help me! Thank you so much!