![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 6
OS: Windows XP SP2 / Ubuntu Linux 7.2
|
PHP: When is __destruct() called?
Hi,
I'm I've been programming in PHP4 for a few years now and am slowly moving over to PHP5, I was wondering when developing a class when the __destruct() function is called? I have put all my closing connections in it, and tried to print to screen for confirmation but it doesn't print anything. Any thoughts? Thanks in advance |
|
|
|
|
|
#2 (permalink) |
|
TSF Enthusiast
Join Date: Jul 2007
Location: Northampton, UK
Posts: 914
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)
|
Re: PHP: When is __destruct() called?
hmm, could you post some code? sorry i haven't used PHP in a while, but as a general programming concept you only destroy an instance of a class when you're done with it (e.g. once everything's been output)... but i don't know the situation so if you were to post code it would help.
Cheers, Jamey
__________________
=] |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 6
OS: Windows XP SP2 / Ubuntu Linux 7.2
|
Re: PHP: When is __destruct() called?
PHP Code:
|
|
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 6
OS: Windows XP SP2 / Ubuntu Linux 7.2
|
Re: PHP: When is __destruct() called?
Sounds as though it should be done automatically, but for some reason it doesn't?
http://uk.php.net/manual/en/language.oop5.decon.php |
|
|
|
![]() |
| Thread Tools | |
|
|