That was the first thing I tried. I don't think I explained the situation well in the original post, lemme try again.
I have three (figurative) classes: A, B, and C, defined similar to the following:
class A {
function afunc($arg) {
$var = new B();
$a = $var->bfunc();
return $a;
}
};
class B {
function B() {
$cval = new C();
$aval = A::afunc($cval);
// do something with $aval here
}
function bfunc() {
return 'something';
}
};
class C {
function cfunc() {
return 'something';
}
};
A and B absolutely require each other, whereas C is required by B but C itself relies on nothing ('$arg' is representative of something used, but is irrelevant for this problem).