concatenating class instances?
| From: | Michael Caplan | Date: | Thu, 23 May 2002 16:58:01 +0000 |
| Subject: | concatenating class instances? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98943@lists.php.net to get a copy of this message | ||
Hi,
Quick question. The below code snippet responded in a way that I didn't
expect. I created an instance of the class frameWork, and then created an
instance of the section class which is assigned to the same variable. I
thought that the second instance would overwrite the frameWork object.
Instead, I discovered that the frameWork object instead inherited the
methods and properties of the new object, while maintaining the methods and
properties of the old object.
require_once('libraries/frameWork.php');
$frameWork = new frameWork;
include('libraries/section.php');
$frameWork = new section;
Am I correct to assume that this is the default behavior in the above
circumstance?
Thanks,
Michael