<?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/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: How To Write A Function In PHP</title>
	<atom:link href="http://www.brandonsavage.net/how-to-write-a-function-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/</link>
	<description>The personal blog of Brandon Savage. Contains entries of a personal and professional nature focusing on PHP, Apple, LAMP, MySQL and Washington, DC.</description>
	<lastBuildDate>Thu, 18 Mar 2010 20:17:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1740</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 26 Oct 2009 09:48:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1740</guid>
		<description>I always make the mistake of confusing print() with a function because it has a return value, unlike echo(). My bad!</description>
		<content:encoded><![CDATA[<p>I always make the mistake of confusing print() with a function because it has a return value, unlike echo(). My bad!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samuel Folkes</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1732</link>
		<dc:creator>Samuel Folkes</dc:creator>
		<pubDate>Mon, 26 Oct 2009 04:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1732</guid>
		<description>Excellent article. I just have one teensy tiny problem: print() is actually not a function. Its a language construct. That aside, good work!</description>
		<content:encoded><![CDATA[<p>Excellent article. I just have one teensy tiny problem: print() is actually not a function. Its a language construct. That aside, good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Weirdan</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1568</link>
		<dc:creator>Bruce Weirdan</dc:creator>
		<pubDate>Mon, 12 Oct 2009 21:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1568</guid>
		<description>&gt; Hey Bruce, I fixed that syntax error earlier, and it looks to be fixed in my version. Are you seeing it differently?
No, I just had this tab opened since morning, and forgot to refresh prior to posting.</description>
		<content:encoded><![CDATA[<p>&gt; Hey Bruce, I fixed that syntax error earlier, and it looks to be fixed in my version. Are you seeing it differently?<br />
No, I just had this tab opened since morning, and forgot to refresh prior to posting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1567</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 12 Oct 2009 21:39:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1567</guid>
		<description>Hey Bruce, I fixed that syntax error earlier, and it looks to be fixed in my version. Are you seeing it differently?</description>
		<content:encoded><![CDATA[<p>Hey Bruce, I fixed that syntax error earlier, and it looks to be fixed in my version. Are you seeing it differently?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Weirdan</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1566</link>
		<dc:creator>Bruce Weirdan</dc:creator>
		<pubDate>Mon, 12 Oct 2009 21:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1566</guid>
		<description>&gt; I think its important to say, that objects since PHP 5 always are passed by reference.

Well, it&#039;s not true. In fact Brandon linked in this very blog post to the article by Sara Golemon that specifically deals with this very misconception.</description>
		<content:encoded><![CDATA[<p>&gt; I think its important to say, that objects since PHP 5 always are passed by reference.</p>
<p>Well, it&#8217;s not true. In fact Brandon linked in this very blog post to the article by Sara Golemon that specifically deals with this very misconception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Weirdan</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1565</link>
		<dc:creator>Bruce Weirdan</dc:creator>
		<pubDate>Mon, 12 Oct 2009 21:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1565</guid>
		<description>&gt; Bear in mind that if you want to assign some of your arguments 
&gt; default values, it is best to place these arguments towards the
&gt; end of your function signature. The reason is that if you place 
&gt; them at the front, you will have to assign them a null value.
Unlike you imply this will not have the same effect as not passing the argument, as illustrated by the following example:

[weirdan@home ~]$ php -r &#039;echo PHP_VERSION . PHP_EOL; function a($b = false, $c = false) { var_dump($b, $c); } a(null);&#039;
5.2.8
NULL
bool(false)
[weirdan@home ~]$

As you can see, $b is null inside the function, just what was passed to the function.

Your goodFunc example have a syntax error:
function goodFunc($var2, $var1 == false) // &lt;--- it should be $var1 = false</description>
		<content:encoded><![CDATA[<p>&gt; Bear in mind that if you want to assign some of your arguments<br />
&gt; default values, it is best to place these arguments towards the<br />
&gt; end of your function signature. The reason is that if you place<br />
&gt; them at the front, you will have to assign them a null value.<br />
Unlike you imply this will not have the same effect as not passing the argument, as illustrated by the following example:</p>
<p>[weirdan@home ~]$ php -r &#8216;echo PHP_VERSION . PHP_EOL; function a($b = false, $c = false) { var_dump($b, $c); } a(null);&#8217;<br />
5.2.8<br />
NULL<br />
bool(false)<br />
[weirdan@home ~]$</p>
<p>As you can see, $b is null inside the function, just what was passed to the function.</p>
<p>Your goodFunc example have a syntax error:<br />
function goodFunc($var2, $var1 == false) // &lt;&#8212; it should be $var1 = false</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1564</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 12 Oct 2009 14:58:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1564</guid>
		<description>Sky, you caught a mistake I made and didn&#039;t catch when I was proofreading. Good eye!

I&#039;ve fixed the mistake.</description>
		<content:encoded><![CDATA[<p>Sky, you caught a mistake I made and didn&#8217;t catch when I was proofreading. Good eye!</p>
<p>I&#8217;ve fixed the mistake.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sky</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1563</link>
		<dc:creator>Sky</dc:creator>
		<pubDate>Mon, 12 Oct 2009 14:48:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1563</guid>
		<description>Hello

Why do you use this : 
function goodFunc($var2, $var1 == false)

When you can use this : 
function goodFunc($var2, $var1 = false)

The default value of a variable is a definition, not a comparaison.

Sry if i got something whrong.</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>Why do you use this :<br />
function goodFunc($var2, $var1 == false)</p>
<p>When you can use this :<br />
function goodFunc($var2, $var1 = false)</p>
<p>The default value of a variable is a definition, not a comparaison.</p>
<p>Sry if i got something whrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ulf Wendel</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1560</link>
		<dc:creator>Ulf Wendel</dc:creator>
		<pubDate>Mon, 12 Oct 2009 08:20:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1560</guid>
		<description>... and if you are beginner and use ext/mysql you code crap. The current MySQL extension is ext/mysqli. The php.net manual tells you why.</description>
		<content:encoded><![CDATA[<p>&#8230; and if you are beginner and use ext/mysql you code crap. The current MySQL extension is ext/mysqli. The php.net manual tells you why.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flyingmana</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1559</link>
		<dc:creator>Flyingmana</dc:creator>
		<pubDate>Mon, 12 Oct 2009 07:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1559</guid>
		<description>I think its important to say, that objects since PHP 5 always are passed by reference.</description>
		<content:encoded><![CDATA[<p>I think its important to say, that objects since PHP 5 always are passed by reference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niels</title>
		<link>http://www.brandonsavage.net/how-to-write-a-function-in-php/#comment-1558</link>
		<dc:creator>Niels</dc:creator>
		<pubDate>Mon, 12 Oct 2009 05:53:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=815#comment-1558</guid>
		<description>Scripting is not a programming paradigm[1] like object-orientation or procedural ;-) It expresses just the fact that programs of a scripting language need not be compiled before execution.

1: http://en.wikipedia.org/wiki/Programming_paradigm</description>
		<content:encoded><![CDATA[<p>Scripting is not a programming paradigm[1] like object-orientation or procedural ;-) It expresses just the fact that programs of a scripting language need not be compiled before execution.</p>
<p>1: <a href="http://en.wikipedia.org/wiki/Programming_paradigm" rel="nofollow">http://en.wikipedia.org/wiki/Programming_paradigm</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
