note 5858 deleted from Classes and Objects by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Thu, 14 Sep 2000 12:02:01 +0000 |
| Subject: | note 5858 deleted from Classes and Objects by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4992@lists.php.net to get a copy of this message | ||
Let TestClass be some class.
$object = new TestClass;
// Perform operations on $object.
$object2 = $object;
$object->somedata = $somevalue;
print $object->somedata." ".$object2->somedata;
<pre>
I'm trying to see if they print the same value. $object->somedata prints accordingly though
$object2->somedata prints nothing (null?). Why is this? In my case I do not need $object2 to be a
reference to $object but rather a copy. Can this be done given the previous structure?