I'll try.

/* This function instantiates and returns a new Parent class. */
function createParent()
{
    return new Parent;
}
/* $p is a reference of the Parent object created by createParent(). */
$p = &createParent();
I believe the problem occurs here. $p becomes a reference to the createParent() function whose return value is the Parent object.

This *should* work:

function createParent()
{
//the lack of the '()' might have caused other problems
return &new Parent();
}

$p = createParent();

That way $p equals the value that is returned by the function createParent, which is a reference to the Parent object.

Then again, I haven't tested any of this, just going on some instinct here.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to