<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 25 May 2013 09:06:12 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DevShed: The Destruct Magic Function in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/12742</guid>
      <link>http://www.phpdeveloper.org/news/12742</link>
      <description><![CDATA[<p>
DevShed has posted the <a href="http://www.devshed.com/c/a/PHP/The-Destruct-Magic-Function-in-PHP-5/">second to last part</a> 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.
</p>
<blockquote>
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. 
</blockquote>
<p>
They update their <a href="http://www.devshed.com/c/a/PHP/The-Destruct-Magic-Function-in-PHP-5/2/">example class</a> with a new __destruct method that takes the user information inserted previously, serializes it and drops it into the current session.
</p>]]></description>
      <pubDate>Wed, 24 Jun 2009 08:46:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Travis Swicegood's Blog:  Pushing the boundries of PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/8956</guid>
      <link>http://www.phpdeveloper.org/news/8956</link>
      <description><![CDATA[<p>
While working with <a href="http://www.travisswicegood.com/index.php/2007/11/01/pushing_the_boundries_of_php">some code</a> of his, <i>Travis Swicegood</i> noticed something odd when he tried to work with Exceptions in a __destruct call:
</p>
<blockquote>
You must be doing something right when you can send PHP into a tail spin. That or the code you're trying to do is just evil. Turns out __destruct() and __call() don't play well together in 5.2.4 if, and only if, you create an instance of an object without assigning it.
</blockquote>
<p>
The <a href="http://bugs.php.net/bug.php?id=43175">official (and verified) bug</a> over on the bugs.php.net site gets into more detail on it including a code block that illustrates the point as simply as possible.
</p>
<blockquote>
In the example I blogged about, __destruct() actually wants 
to catch any exceptions so it can create meaningful output based on 
the Exceptions that were generated.  In that case, __destruct() would 
have returned peacefully. [...] At any rate, my take on that would be that would still be that if 
__destruct() is finished and an exception is still present, then 
there's an error.  Otherwise, how would you handle things such as 
PDOExceptions thrown during DB clean-up?
</blockquote>]]></description>
      <pubDate>Thu, 01 Nov 2007 16:48:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP-Coding-Practices.com: How Table Migrations In CakePHP 1.2 Can Save Your Life]]></title>
      <guid>http://www.phpdeveloper.org/news/8174</guid>
      <link>http://www.phpdeveloper.org/news/8174</link>
      <description><![CDATA[<p>
On PHP-Coding-Practices.com, <i>Tim Koschuetzki</i> has <a href="http://php-coding-practices.com/cakephp-specific/how-table-migrations-in-cakephp-12-can-save-your-life/">posted a new tutorial</a> that just might save your life - well, at least the life of your CakePHP application - using table migrations.
</p>
<blockquote>
Migrations are a wonderful technique to keep your database in sync with your code. When working on a project as a team, migrations can save your life. Please join me and get a quick introduction to migrations in CakePHP and become a happier coder.
</blockquote>
<p>
He <a href="http://php-coding-practices.com/cakephp-specific/how-table-migrations-in-cakephp-12-can-save-your-life/">starts by explaining</a> what migrations are (yml files that contain database construction/destruction information), how to execute them in your application, and how to construct your own.
</p>]]></description>
      <pubDate>Tue, 03 Jul 2007 14:36:07 -0500</pubDate>
    </item>
  </channel>
</rss>
