To elaborate a little, the 'correct' way to pass by reference in PHP 4 would be
$a = null;
class a
{
var $a = 0;
function a()
{
//
}
function b()
{
$this->a = 1;
}
function c()
{
echo $this->a . "<br>";
}
}
$obj = new a; // New object
echo $obj->c(); // Call get method
$a =& $obj; // Create reference
$a->b(); // Call set method on reference
echo $obj->c(); // Call get method again
Creating references inside of a class is likely to cause a headache in the end, no?