Rick den Haan scribeva in 18/04/2007 8:31:
> I could potentially pass $this along, but I
> doubt if that's a very recommendable practice.
It would be exactly what I'd recommend.
In X you'd have:
$y = new Y($this);
and in Y:
function Y(&$ref) {
echo $ref->foo;
}
Note that you are passing a reference, not a copy.
.k