Hi
This should do it:
class parentClass {
var $x;
var $child;
function parentClass($_x, &$_child) {//<
$this->x = $_x;
$this->child =& $_child; //<<
$this->child->m = "Grow up, son";
}
function foo() {
return "I'm the parent.";
}
}
class
suggestions.
TIA-
Geoff
-Original Message-
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 7:06 AM
To: Hoffman, Geoffrey
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] object passing by reference
At 01:34 27.11.2002, Hoffman, Geoffrey spoke out a
At 01:34 27.11.2002, Hoffman, Geoffrey spoke out and said:
[snip]
>I want to pass a reference to objectA along with other strings to a new
>objectB( constructor.
>
>Where does my & go? I just keep getting
>
>Fatal error: Call to a member function on a non-ob
I want to pass a reference to objectA along with other strings to a new
objectB( constructor.
Where does my & go? I just keep getting
Fatal error: Call to a member function on a non-object
Geoff Hoffman
Web Designer/Programmer
AZ Interactive Media Group
Work: (480) 898-7730
Cell: (480) 231-832
4 matches
Mail list logo