News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
The Destruct Magic Function in PHP 5
June 24, 2009 @ 08:46:18

DevShed has posted the second to last part of their tutorial series looking at the magic functions in PHP. This time they focus on the destruct function, a method that is fired off when an object is being removed from memory.

There are a few [other methods] that can be really useful for performing relatively complex tasks with a minimal amount of code. That's exactly the case with the "__destruct()" method, which will be called automatically by the PHP engine before destroying an instance of a particular class at the end of a script.

They update their example class with a new __destruct method that takes the user information inserted previously, serializes it and drops it into the current session.

0 comments voice your opinion now!
tutorial function magic destruct


blog comments powered by Disqus

Similar Posts

Matthew Weier O'Phinney's Blog: Creating Re-Usable Zend_Application Resource Plugins

XpertDeveloper.com: PHP clearstatecache() Explained

Raphael Stolt's Blog: Using MongoHq in Zend Framework based applications

NetTuts.com: Build Ajax Data Grids with CodeIgniter and jQuery

IBM developerWorks: Implement access control with Agavi


Community Events





Don't see your event here?
Let us know!


series introduction install podcast interview framework package deployment language laravel library community api symfony release bugfix tips opinion voicesoftheelephpant list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework