Unexpected OOP behavior
| From: | Richard Fox | Date: | Thu, 25 Apr 2002 17:10:04 +0000 |
| Subject: | Unexpected OOP behavior | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94589@lists.php.net to get a copy of this message | ||
I noticed a behavior of my PHP class (4.1.1) which I found very unexpected
and also undocumented. I defined a class constructor, and this constructor
was automatically called *again* on my instantiated object when the script
ended! This runs counter to
1. what one would expect a constructor to do
2. what the PHP docs say, which is that any clean up of a class object
must be handled explicitly
Can anyone verify/explain this behavior?
Thanks
Rich