<?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: Note to self: PHP object constructors never return false</title>
	<atom:link href="http://the-stickman.com/web-development/php/note-to-self-php-object-constructors-never-return-false/feed/" rel="self" type="application/rss+xml" />
	<link>http://the-stickman.com/web-development/php/note-to-self-php-object-constructors-never-return-false/</link>
	<description>Random developer notes</description>
	<lastBuildDate>Wed, 03 Aug 2011 09:35:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: Jeff</title>
		<link>http://the-stickman.com/web-development/php/note-to-self-php-object-constructors-never-return-false/comment-page-1/#comment-1594</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Thu, 12 May 2011 14:02:03 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/uncategorized/note-to-self-php-object-constructors-never-return-false/#comment-1594</guid>
		<description>Well, I thought that would work better posting code like that, but the general idea was if a validation test fails, throw a new exception inside the constructor and then surround the object instantiation inside of a try/catch block.

Hope this helps.</description>
		<content:encoded><![CDATA[<p>Well, I thought that would work better posting code like that, but the general idea was if a validation test fails, throw a new exception inside the constructor and then surround the object instantiation inside of a try/catch block.</p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://the-stickman.com/web-development/php/note-to-self-php-object-constructors-never-return-false/comment-page-1/#comment-1593</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Thu, 12 May 2011 13:59:37 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/uncategorized/note-to-self-php-object-constructors-never-return-false/#comment-1593</guid>
		<description>Even though this is old, I stumbled across it so other people might as well.  

Below is a workaround for not being able to return false but yet still ensure valid object creation.

name = $name;
   }
	
   function getName()   { return $this-&gt;name; }
   function __toString(){ return $this-&gt;name; }
}
?&gt;

Instantiation:

getMessage());
   }

   foreach($tests as $k =&gt; $v) {
      echo($v . &quot;&quot;);
   }
?&gt;</description>
		<content:encoded><![CDATA[<p>Even though this is old, I stumbled across it so other people might as well.  </p>
<p>Below is a workaround for not being able to return false but yet still ensure valid object creation.</p>
<p>name = $name;<br />
   }</p>
<p>   function getName()   { return $this-&gt;name; }<br />
   function __toString(){ return $this-&gt;name; }<br />
}<br />
?&gt;</p>
<p>Instantiation:</p>
<p>getMessage());<br />
   }</p>
<p>   foreach($tests as $k =&gt; $v) {<br />
      echo($v . &#8220;&#8221;);<br />
   }<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: S</title>
		<link>http://the-stickman.com/web-development/php/note-to-self-php-object-constructors-never-return-false/comment-page-1/#comment-1116</link>
		<dc:creator>S</dc:creator>
		<pubDate>Sun, 14 Dec 2008 09:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/uncategorized/note-to-self-php-object-constructors-never-return-false/#comment-1116</guid>
		<description>Thank you for this post, I better learn some true error handling then.. damn ;)</description>
		<content:encoded><![CDATA[<p>Thank you for this post, I better learn some true error handling then.. damn <img src='http://the-stickman.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: schmoove</title>
		<link>http://the-stickman.com/web-development/php/note-to-self-php-object-constructors-never-return-false/comment-page-1/#comment-1061</link>
		<dc:creator>schmoove</dc:creator>
		<pubDate>Mon, 01 Sep 2008 11:52:08 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/uncategorized/note-to-self-php-object-constructors-never-return-false/#comment-1061</guid>
		<description>Andre’s hack will not work with PHP5:

&quot;Fatal error: Cannot re-assign $this&quot;</description>
		<content:encoded><![CDATA[<p>Andre’s hack will not work with PHP5:</p>
<p>&#8220;Fatal error: Cannot re-assign $this&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://the-stickman.com/web-development/php/note-to-self-php-object-constructors-never-return-false/comment-page-1/#comment-1056</link>
		<dc:creator>John</dc:creator>
		<pubDate>Wed, 20 Aug 2008 14:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/uncategorized/note-to-self-php-object-constructors-never-return-false/#comment-1056</guid>
		<description>Check out Andre&#039;s hack at the bottom of the page:

http://bugs.php.net/bug.php?id=9253&amp;edit=1</description>
		<content:encoded><![CDATA[<p>Check out Andre&#8217;s hack at the bottom of the page:</p>
<p><a href="http://bugs.php.net/bug.php?id=9253&#038;edit=1" rel="nofollow">http://bugs.php.net/bug.php?id=9253&#038;edit=1</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

