I'm managing an PHP application and we want to enable APC now. The problem is that we have two classes which require_once each other. A very basic example would look like:
in class_a.php
require_once('path/to/class_b.php)';
class a extends something {
//
}
in class_b.php
require_once('path/to/class_a.php');
class b extends something2 {
//
}
However, when we enable APC, there is an "[apc-error] Cannot redeclare class class_b in class_b.php". Ok, that's because the class has been already loaded via the require_once() in class_a.php so if some 3th file requre class_b.php, APC will raise the error.
How to solve this "circular reference-like" issue?