<?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: Me griping about PHP  :) (closures this time)</title>
	<atom:link href="http://michaelkimsal.com/blog/me-griping-about-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelkimsal.com/blog/me-griping-about-php/</link>
	<description>Web development and new media observations</description>
	<lastBuildDate>Thu, 11 Mar 2010 21:02:37 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sean</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-69172</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Tue, 23 Jun 2009 15:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-69172</guid>
		<description>I think its worth noting that at least as of PHP 5.3.0-RC5-dev, the ReflectionMethod::getClosure() method was removed due to issues with how the PHP engine should resolve the &lt;strong$this&lt;/strong&gt; keyword. I&#039;ve been struggling to find another way to get a closures for methods (including protected and private) within the context of an object since discovering the functionality I thought existed was yanked.

I have come across this blog-posting several times while doing these searches and thought this might be useful details for whoever is struggling with closures as well.

I filed a bug report on the PHP bug tracker, which has since been closed as bogus, where the removal of getClosure() was cited.

&lt;a href=&quot;http://bugs.php.net/bug.php?id=48654&quot; rel=&quot;nofollow&quot;&gt;Bug #48654  	ReflectionMethod::getClosure() Undefined on Windows binary for PHP 5.3.0RC5-dev&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I think its worth noting that at least as of PHP 5.3.0-RC5-dev, the ReflectionMethod::getClosure() method was removed due to issues with how the PHP engine should resolve the &lt;strong$this keyword. I&#8217;ve been struggling to find another way to get a closures for methods (including protected and private) within the context of an object since discovering the functionality I thought existed was yanked.</p>
<p>I have come across this blog-posting several times while doing these searches and thought this might be useful details for whoever is struggling with closures as well.</p>
<p>I filed a bug report on the PHP bug tracker, which has since been closed as bogus, where the removal of getClosure() was cited.</p>
<p><a href="http://bugs.php.net/bug.php?id=48654" rel="nofollow">Bug #48654  	ReflectionMethod::getClosure() Undefined on Windows binary for PHP 5.3.0RC5-dev</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mgkimsal</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-55008</link>
		<dc:creator>mgkimsal</dc:creator>
		<pubDate>Wed, 24 Dec 2008 14:58:22 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-55008</guid>
		<description>Thread has died down but I&#039;ll ask (maybe someone will pick this up and clarify).

How many (and/or which) changes to PHP of any moderate complexity or significance have been introduced by people who did not also simultaneously (or near enough) submit a proof of concept of their enhancement with a code patch?     A quick look at wiki.php.net/rfc shows that about half of the RFCs have patches with them, and many of the ones that don&#039;t aren&#039;t really code related (&quot;siberia&quot;, etc.)  Also, why is it called an RFC system if there&#039;s no place for people to leave comments on the page?

My initial stab (not done) at an RFC is http://wiki.php.net/rfc/automatic_get_set_methods - it really is a &quot;request for comments&quot; but since there&#039;s no place to put comments there, feel free to comment here or on my earlier post about get/set stuff.</description>
		<content:encoded><![CDATA[<p>Thread has died down but I&#8217;ll ask (maybe someone will pick this up and clarify).</p>
<p>How many (and/or which) changes to PHP of any moderate complexity or significance have been introduced by people who did not also simultaneously (or near enough) submit a proof of concept of their enhancement with a code patch?     A quick look at wiki.php.net/rfc shows that about half of the RFCs have patches with them, and many of the ones that don&#8217;t aren&#8217;t really code related (&#8221;siberia&#8221;, etc.)  Also, why is it called an RFC system if there&#8217;s no place for people to leave comments on the page?</p>
<p>My initial stab (not done) at an RFC is <a href="http://wiki.php.net/rfc/automatic_get_set_methods" rel="nofollow">http://wiki.php.net/rfc/automatic_get_set_methods</a> &#8211; it really is a &#8220;request for comments&#8221; but since there&#8217;s no place to put comments there, feel free to comment here or on my earlier post about get/set stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Kimsal&#8217;s Blog: Me griping about PHP :) (closures this time) : WebNetiques</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-54983</link>
		<dc:creator>Michael Kimsal&#8217;s Blog: Me griping about PHP :) (closures this time) : WebNetiques</dc:creator>
		<pubDate>Wed, 24 Dec 2008 10:17:24 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-54983</guid>
		<description>[...] Kimsal has posted a few thoughts on one of the features of the upcoming PHP 5.3 - [...]</description>
		<content:encoded><![CDATA[<p>[...] Kimsal has posted a few thoughts on one of the features of the upcoming PHP 5.3 &#8211; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mgkimsal</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-54881</link>
		<dc:creator>mgkimsal</dc:creator>
		<pubDate>Tue, 23 Dec 2008 12:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-54881</guid>
		<description>People are paying to learn how to write PHP, and it has some value to them in that regard.</description>
		<content:encoded><![CDATA[<p>People are paying to learn how to write PHP, and it has some value to them in that regard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Clarkson</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-54870</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Tue, 23 Dec 2008 09:36:11 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-54870</guid>
		<description>Perhaps it would be wise to teach something other than PHP.  Learning PHP has no value other than if you are going to write PHP, because of all the inconsistency and ugliness, whereas many other languages have useful things to teach you about programming.</description>
		<content:encoded><![CDATA[<p>Perhaps it would be wise to teach something other than PHP.  Learning PHP has no value other than if you are going to write PHP, because of all the inconsistency and ugliness, whereas many other languages have useful things to teach you about programming.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mgkimsal</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-54828</link>
		<dc:creator>mgkimsal</dc:creator>
		<pubDate>Mon, 22 Dec 2008 19:18:24 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-54828</guid>
		<description>Bind the ones that are used in the anonymous function (thereby making it a closure).  

What I&#039;ve just read here is that &#039;use&#039; was used instead of &#039;import&#039;, but the idea is to bring in certain variables from the local scope (scope of the code that&#039;s defining the function) to be available in the anonymous function / closure.  This feels redundant, and given my experience with closures in other languages, this explicit naming of local variables to be used in the function is not needed.

&lt;a href=&quot;http://aspn.activestate.com/ASPN/Mail/Message/php-dev/3642524&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is where Wez mentions it in passing - &quot;Since everyone has grown up explicitly managing this via the global keyword, I think it makes a lot of sense to use similar syntax for getting at those lexical values.&quot;  So, this seems it&#039;s more of a style issue than a technical one.  It would seem that any reference to a variable that&#039;s not defined in the anonymous function could check the variable names of the parent code where it was defined to see if it exists there, then import it.  But that&#039;s not how it&#039;s done - we use the &#039;use&#039; keyword, which I&#039;m simply saying isn&#039;t something I care for.
</description>
		<content:encoded><![CDATA[<p>Bind the ones that are used in the anonymous function (thereby making it a closure).  </p>
<p>What I&#8217;ve just read here is that &#8216;use&#8217; was used instead of &#8216;import&#8217;, but the idea is to bring in certain variables from the local scope (scope of the code that&#8217;s defining the function) to be available in the anonymous function / closure.  This feels redundant, and given my experience with closures in other languages, this explicit naming of local variables to be used in the function is not needed.</p>
<p><a href="http://aspn.activestate.com/ASPN/Mail/Message/php-dev/3642524" rel="nofollow">Here</a> is where Wez mentions it in passing &#8211; &#8220;Since everyone has grown up explicitly managing this via the global keyword, I think it makes a lot of sense to use similar syntax for getting at those lexical values.&#8221;  So, this seems it&#8217;s more of a style issue than a technical one.  It would seem that any reference to a variable that&#8217;s not defined in the anonymous function could check the variable names of the parent code where it was defined to see if it exists there, then import it.  But that&#8217;s not how it&#8217;s done &#8211; we use the &#8216;use&#8217; keyword, which I&#8217;m simply saying isn&#8217;t something I care for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-54827</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 22 Dec 2008 19:05:09 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-54827</guid>
		<description>@mgkimsal 
because there are incredibly legitimate reasons why you would not want all of the parameters bound.</description>
		<content:encoded><![CDATA[<p>@mgkimsal<br />
because there are incredibly legitimate reasons why you would not want all of the parameters bound.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lb</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-54826</link>
		<dc:creator>lb</dc:creator>
		<pubDate>Mon, 22 Dec 2008 18:47:49 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-54826</guid>
		<description>Why don&#039;t you just quit bitching, live with it and write awesome code.

You&#039;ve done the hard bit, you understand the construct. Bitching won&#039;t change the code.</description>
		<content:encoded><![CDATA[<p>Why don&#8217;t you just quit bitching, live with it and write awesome code.</p>
<p>You&#8217;ve done the hard bit, you understand the construct. Bitching won&#8217;t change the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mgkimsal</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-54825</link>
		<dc:creator>mgkimsal</dc:creator>
		<pubDate>Mon, 22 Dec 2008 18:33:50 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-54825</guid>
		<description>@sean - i wouldn&#039;t say it&#039;s a flaw.  Why not auto-bind whatever variables that are used in the function definition?</description>
		<content:encoded><![CDATA[<p>@sean &#8211; i wouldn&#8217;t say it&#8217;s a flaw.  Why not auto-bind whatever variables that are used in the function definition?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean McSomething</title>
		<link>http://michaelkimsal.com/blog/me-griping-about-php/comment-page-1/#comment-54823</link>
		<dc:creator>Sean McSomething</dc:creator>
		<pubDate>Mon, 22 Dec 2008 18:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://michaelkimsal.com/blog/?p=660#comment-54823</guid>
		<description>I&#039;m surprised that nobody&#039;s picked up on a glaring flaw in your proposal - &quot;funciton($arg1, $arg2...) use $bound&quot; allows you to create closures that have both arguments and bound variables.  Your suggestion only makes room for the bound variables, significantly reducing the usefulness of the construct.</description>
		<content:encoded><![CDATA[<p>I&#8217;m surprised that nobody&#8217;s picked up on a glaring flaw in your proposal &#8211; &#8220;funciton($arg1, $arg2&#8230;) use $bound&#8221; allows you to create closures that have both arguments and bound variables.  Your suggestion only makes room for the bound variables, significantly reducing the usefulness of the construct.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
