<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>Forums, Blogs, Wikis Topic: Clear all PHP class variables</title>
<link>http://forumsblogswikis.com/forum/</link>
<description>Forums, Blogs, Wikis Topic: Clear all PHP class variables</description>
<language>en</language>
<pubDate>Thu, 09 Sep 2010 18:54:01 +0000</pubDate>

<item>
<title>ryan on "Clear all PHP class variables"</title>
<link>http://forumsblogswikis.com/forum/topic/19#post-35</link>
<pubDate>Fri, 27 Jun 2008 11:07:33 +0000</pubDate>
<dc:creator>ryan</dc:creator>
<guid isPermaLink="false">35@http://forumsblogswikis.com/forum/</guid>
<description>&#60;p&#62;The more I'm using data classes in PHP the more I find myself writing _clear() functions to empty out the variables.  I finally did some searching and found a starting point for a function that would do it for me without having to hard code in each of the variable names.  I don't remember where this starting point came from, but it didn't work out of the box anyway.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;function _clear()&#60;br /&#62;
	{&#60;br /&#62;
	$arr = get_object_vars($this);&#60;br /&#62;
	foreach ($arr as $key =&#38;gt; $value)&#60;br /&#62;
		{&#60;br /&#62;
		unset($this-&#38;gt;$key);&#60;br /&#62;
		}&#60;br /&#62;
	}&#60;/code&#62;
&#60;/p&#62;</description>
</item>

</channel>
</rss>
