![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| 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 |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 9
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 |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,887
OS: Vista, various linux distros
|
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: 9
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: 9
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 | |
|
|