According to this PHP bug report, the error message is caused by nesting a class in an if statement and having it declared statically as well.
I have a class declared in only one place, but I've protected it with an if:
if (!class_exists('myClass', false)) {
class myClass{
(Trying to do something similar to the C++ pre-processor directives / conditional inclusions.)
This was to prevent failing from the possibility of multiple coders including it improperly (require instead of require_once). My only other alternative at this point is to comment out the if's and search the application for includes and just make them all "require_once's".
So, has anyone else ran into this error, and is there a way to get around besides changing all the requires to require_once? (This software is maintained by multiple coders, so I'd like to keep it from failing.)
- This error only occurs on occasion (randomly) and when it does, I have to add / remove a space from the class file and re-save to fix the error.
On a side note, the main reason we installed APC was for file upload progress support for IE 9 and under. So if we can keep just those parts enabled we could disable whatever feature causes this. (Not sure if that's possible.)
Update: Resaving the file apparently doesn't have an effect. It looks like it has a sort of "timeout". When the error occurs, I have to simply wait a while for it to go away.