PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Jean-Yves
Forum Contributor
Posts: 148 Joined: Wed Jul 02, 2003 2:13 pm
Location: West Country, UK
Post
by Jean-Yves » Wed Mar 02, 2005 8:54 am
Hi,
If I do the following
Code: Select all
$objectA = new MyObject;
$objectB = $objectA;
I have two separate objects. Changing the values of attributes in A for example does not change the attributes in B.
What I would like is two
references to the object created in the first line. How do I go about doing that in PHP4 syntax?
Many thanks.
Last edited by
Jean-Yves on Wed Mar 02, 2005 9:43 am, edited 1 time in total.
smpdawg
Forum Contributor
Posts: 292 Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:
Post
by smpdawg » Wed Mar 02, 2005 9:10 am
Use this to get the reference.
Jean-Yves
Forum Contributor
Posts: 148 Joined: Wed Jul 02, 2003 2:13 pm
Location: West Country, UK
Post
by Jean-Yves » Wed Mar 02, 2005 9:40 am
THanks very much, works perfectly.
smpdawg
Forum Contributor
Posts: 292 Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:
Post
by smpdawg » Wed Mar 02, 2005 9:51 am
That's what I am here for.