<?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: Lexical scope to appear in PHP?</title>
	<atom:link href="http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<lastBuildDate>Sun, 08 Nov 2009 20:06:11 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: P. Aichpy</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-918563</link>
		<dc:creator>P. Aichpy</dc:creator>
		<pubDate>Thu, 16 Apr 2009 20:05:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-918563</guid>
		<description>I posted a feature request last year for an optional lexical scoping keyword. Unfortunately it seems to be just collecting dust:
http://bugs.php.net/bug.php?id=46504

The lack of this feature and a pre-execution check for undeclared variables (like &#039;use strict&#039; in Perl) are 2 things that make PHP truly suck right now.</description>
		<content:encoded><![CDATA[<p>I posted a feature request last year for an optional lexical scoping keyword. Unfortunately it seems to be just collecting dust:<br />
<a href="http://bugs.php.net/bug.php?id=46504" rel="nofollow">http://bugs.php.net/bug.php?id=46504</a></p>
<p>The lack of this feature and a pre-execution check for undeclared variables (like &#8216;use strict&#8217; in Perl) are 2 things that make PHP truly suck right now.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: ArkInfotec.com &#187; Blog Archive &#187; Keeping Current With PHP</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-774608</link>
		<dc:creator>ArkInfotec.com &#187; Blog Archive &#187; Keeping Current With PHP</dc:creator>
		<pubDate>Tue, 05 Aug 2008 08:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-774608</guid>
		<description>[...] which - as the name implies - contains RFC&#8217;s for improvements of the language. I&#8217;ve rambled on about closures and lambdas before, but as you can see, there is now an accepted patch. Whether it&#8217;ll make it into 5.3 is [...]</description>
		<content:encoded><![CDATA[<p>[...] which &#8211; as the name implies &#8211; contains RFC&#8217;s for improvements of the language. I&#8217;ve rambled on about closures and lambdas before, but as you can see, there is now an accepted patch. Whether it&#8217;ll make it into 5.3 is [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: SitePoint PHP Blog: Keeping current with PHP &#124; Development Blog With Code Updates : Developercast.com</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-761977</link>
		<dc:creator>SitePoint PHP Blog: Keeping current with PHP &#124; Development Blog With Code Updates : Developercast.com</dc:creator>
		<pubDate>Wed, 16 Jul 2008 14:09:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-761977</guid>
		<description>[...] which - as the name implies - contains RFC&#8217;s for improvements of the language. I&#8217;ve rambled on about closures and lambdas before, but as you can see, there is now an accepted patch. Whether it&#8217;ll make it into 5.3 is [...]</description>
		<content:encoded><![CDATA[<p>[...] which &#8211; as the name implies &#8211; contains RFC&#8217;s for improvements of the language. I&#8217;ve rambled on about closures and lambdas before, but as you can see, there is now an accepted patch. Whether it&#8217;ll make it into 5.3 is [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: kyberfabrikken</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-622803</link>
		<dc:creator>kyberfabrikken</dc:creator>
		<pubDate>Sun, 03 Feb 2008 10:39:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-622803</guid>
		<description>Hi Marcus,

That would be:
http://del.icio.us/kyberfabrikken</description>
		<content:encoded><![CDATA[<p>Hi Marcus,</p>
<p>That would be:<br />
<a href="http://del.icio.us/kyberfabrikken" rel="nofollow">http://del.icio.us/kyberfabrikken</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: lastcraft</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-622389</link>
		<dc:creator>lastcraft</dc:creator>
		<pubDate>Sat, 02 Feb 2008 21:58:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-622389</guid>
		<description>Hi Troels...

What is your delicious name? I suspect we may have quite a few bookmarks in common.

yours, Marcus</description>
		<content:encoded><![CDATA[<p>Hi Troels&#8230;</p>
<p>What is your delicious name? I suspect we may have quite a few bookmarks in common.</p>
<p>yours, Marcus</p>]]></content:encoded>
	</item>
	<item>
		<title>By: honeymonster</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-577867</link>
		<dc:creator>honeymonster</dc:creator>
		<pubDate>Sun, 30 Dec 2007 16:14:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-577867</guid>
		<description>Seems this is sort of a half-baked closure. The lexical scoping rules is at odds with the object orientation of PHP5. You cannot access/capture member variables the sorrounding class without assigning them to a local variable first. This will probably work because of the rather strange alias assignment; so that you can do $localvar = $membervar; before accessing $localvar from inside the &quot;closure&quot;. 

Does this work for simple types as well, or will the closure simply operate on the captured &lt;em&gt;values&lt;/em&gt;?

To some extent this is analogous to the &quot;assign before return&quot; requirement like &quot;return $dummy=(some expression)&quot;. It is still not very elegant, though.</description>
		<content:encoded><![CDATA[<p>Seems this is sort of a half-baked closure. The lexical scoping rules is at odds with the object orientation of PHP5. You cannot access/capture member variables the sorrounding class without assigning them to a local variable first. This will probably work because of the rather strange alias assignment; so that you can do $localvar = $membervar; before accessing $localvar from inside the &#8220;closure&#8221;. </p>
<p>Does this work for simple types as well, or will the closure simply operate on the captured <em>values</em>?</p>
<p>To some extent this is analogous to the &#8220;assign before return&#8221; requirement like &#8220;return $dummy=(some expression)&#8221;. It is still not very elegant, though.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: developercast.com &#187; SitePoint PHP Blog: Lexical scope to appear in PHP?</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-570187</link>
		<dc:creator>developercast.com &#187; SitePoint PHP Blog: Lexical scope to appear in PHP?</dc:creator>
		<pubDate>Tue, 25 Dec 2007 16:21:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-570187</guid>
		<description>[...] this new post to the SitePoint PHP blog, Troels Knak-Nielsen talks about some of the advancements (and [...]</description>
		<content:encoded><![CDATA[<p>[...] this new post to the SitePoint PHP blog, Troels Knak-Nielsen talks about some of the advancements (and [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: binjured</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-568889</link>
		<dc:creator>binjured</dc:creator>
		<pubDate>Mon, 24 Dec 2007 14:07:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-568889</guid>
		<description>This is another case of PHP being &quot;dumb,&quot; for lack of a better term.  Why can&#039;t it just &lt;em&gt;know&lt;/em&gt; the correct scope of &lt;em&gt;x&lt;/em&gt;?  Introducing this would probably cause more confusion than anything, created by people trying to create a normal anonymous function without using this &quot;lexical&quot; keyword.

How about...
&lt;code&gt;
def f1(x): return lambda y: x + y
f1(2)(8) # return 10
&lt;/code&gt;
(Brought to you by the &lt;em&gt;United Alliance for a Python Forum on SitePoint&lt;/em&gt;)</description>
		<content:encoded><![CDATA[<p>This is another case of PHP being &#8220;dumb,&#8221; for lack of a better term.  Why can&#8217;t it just <em>know</em> the correct scope of <em>x</em>?  Introducing this would probably cause more confusion than anything, created by people trying to create a normal anonymous function without using this &#8220;lexical&#8221; keyword.</p>
<p>How about&#8230;<br />
<code>
def f1(x): return lambda y: x + y
f1(2)(8) # return 10
</code><br />
(Brought to you by the <em>United Alliance for a Python Forum on SitePoint</em>)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; Blog Archive &#187; Lexical scope to appear in PHP - SitePoint</title>
		<link>http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/comment-page-1/#comment-568651</link>
		<dc:creator>&#187; Blog Archive &#187; Lexical scope to appear in PHP - SitePoint</dc:creator>
		<pubDate>Mon, 24 Dec 2007 10:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2007/12/23/lexical-scope-to-appear-in-php/#comment-568651</guid>
		<description>[...] Lexical scope to appear in PHP - SitePointLexical scope to appear in PHPSitePoint, Australia - Dec 22, 2007Since then, I brought up Wez? original patch again on the php-internals lists. This has prompted some hefty debate over the last week. &#8230; [...]</description>
		<content:encoded><![CDATA[<p>[...] Lexical scope to appear in PHP &#8211; SitePointLexical scope to appear in PHPSitePoint, Australia &#8211; Dec 22, 2007Since then, I brought up Wez? original patch again on the php-internals lists. This has prompted some hefty debate over the last week. &#8230; [...]</p>]]></content:encoded>
	</item>
</channel>
</rss>
