<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Prevent Duplication of Memory with Php5 Singleton Design Pattern</title>
	<atom:link href="http://develturk.com/2009/04/17/prevent-duplication-of-memory-with-php5-singleton-design-pattern/feed/" rel="self" type="application/rss+xml" />
	<link>http://develturk.com/2009/04/17/prevent-duplication-of-memory-with-php5-singleton-design-pattern/</link>
	<description>Ersin Güvenç's Php Development Blog (Turkey)</description>
	<lastBuildDate>Tue, 17 Jan 2012 10:47:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: admin</title>
		<link>http://develturk.com/2009/04/17/prevent-duplication-of-memory-with-php5-singleton-design-pattern/comment-page-1/#comment-1693</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 25 Feb 2010 18:58:26 +0000</pubDate>
		<guid isPermaLink="false">http://develturk.com/?p=74#comment-1693</guid>
		<description>Yes this will not appear, this is a php base rule you can use return word 
&lt;code&gt;
function foo(){
$bar = new MyClass()
return $bar;
}

// call the foo handle
var_dump(foo());  // output object

// get instance way (recommended)
function foo(){
rerturn new MyClass::getInstance()-&gt;do_test();
}

foo();  // do_test output
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Yes this will not appear, this is a php base rule you can use return word<br />
<code><br />
function foo(){<br />
$bar = new MyClass()<br />
return $bar;<br />
}</p>
<p>// call the foo handle<br />
var_dump(foo());  // output object</p>
<p>// get instance way (recommended)<br />
function foo(){<br />
rerturn new MyClass::getInstance()->do_test();<br />
}</p>
<p>foo();  // do_test output<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://develturk.com/2009/04/17/prevent-duplication-of-memory-with-php5-singleton-design-pattern/comment-page-1/#comment-1692</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Thu, 25 Feb 2010 16:49:05 +0000</pubDate>
		<guid isPermaLink="false">http://develturk.com/?p=74#comment-1692</guid>
		<description>this is nice.  My question is if not using singleton, and you instantiate a class inside a function

function foo(){
 $bar = new MyClass()
}

is that class/variable local to the function?  Does it &#039;disappear&#039; when the function completes?</description>
		<content:encoded><![CDATA[<p>this is nice.  My question is if not using singleton, and you instantiate a class inside a function</p>
<p>function foo(){<br />
 $bar = new MyClass()<br />
}</p>
<p>is that class/variable local to the function?  Does it &#8216;disappear&#8217; when the function completes?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

