<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 26 May 2013 02:33:19 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Vance Lucas' Blog:  Get Only Public Class Properties for the Current Class in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/13786</guid>
      <link>http://www.phpdeveloper.org/news/13786</link>
      <description><![CDATA[<p>
On his blog today <i>Vance Lucas</i> has <a href="http://www.vancelucas.com/blog/get-only-public-class-properties-for-current-class-in-php">posted a method</a> you can use to only get the properties of your class that are in the "public" scope.
</p>
<blockquote>
PHP provides two built-in functions to retrieve properties of a given class '" <a href="http://php.net/get_object_vars">get_object_vars</a> and <a href="http://php.net/get_class_vars">get_class_vars</a>. Both these functions behave the same exact way, one taking an object as a variable and the other taking a string class name. The tricky thing about the two functions is that they behave differently depending on the call scope, returning all of the class variables available within the called scope.
</blockquote>
<p>
As a bit of a hack (in lower than PHP 5.3) he shows how to use the <a href="http://php.net/create_function">create_function</a> function to create a small statement in a different scope that returns the only the variables seen from the "outside" - just the public ones. PHP 5.3 users can do it much more cleanly with closures. Code examples for both are included.
</p>]]></description>
      <pubDate>Wed, 06 Jan 2010 10:06:29 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sara Golemon's Blog: create_function() is not your friend]]></title>
      <guid>http://www.phpdeveloper.org/news/7880</guid>
      <link>http://www.phpdeveloper.org/news/7880</link>
      <description><![CDATA[<p>
In response to <a href="http://www.phpdeveloper.org/news/7874">this previous post</a> from <i>Felix Geisendorfer</i>, <i>Sara Golemon</i> <a href="http://blog.libssh2.org/index.php?/archives/60-create_function-is-not-your-friend.html">shares a few thoughts</a> on why she thinks it's just the other way around - create_function is not your friend.
</p>
<p>
In the <a href="http://blog.libssh2.org/index.php?/archives/60-create_function-is-not-your-friend.html">short post</a> she lists just a few of the issues surrounding the use of the function including that it:
<ul>
<li>is prone to critical abuse by user-supplied code
<li>skips opcode cache optimizations
<li>encourages not using comments (evil)
<li>100% blind to reflection or PHPDoc style documentation generation
</ul>
</p>]]></description>
      <pubDate>Mon, 21 May 2007 09:31:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: My new best friend - PHP's create_function()]]></title>
      <guid>http://www.phpdeveloper.org/news/7874</guid>
      <link>http://www.phpdeveloper.org/news/7874</link>
      <description><![CDATA[<p>
In a <a href="http://www.thinkingphp.org/2007/05/18/my-new-best-friend-phps-create_function/">new post</a> to his blog today, <i>Felix Geisendorfer</i> wants to introduce you to his new best friend in the wonderful world of PHP - the create_function function.
</p>
<blockquote>
His name is '<a href="http://php.net/create_function">create_function</a>' and he's a really useful co-worker. For those of you who just vaguely know him - don't worry, he's not so much like his <a href="http://php.net/eval">ev(a|i)l cousin</a>. Well, that doesn't mean he can't be harmful, but he's more likely to help you instead.
</blockquote>
<p>
To show why he's such a good friend, <i>Felix</i> <a href="http://www.thinkingphp.org/2007/05/18/my-new-best-friend-phps-create_function/">includes some example code</a> to help solve a fictional problem of a manager wanting to filter down the information about a few perspective programmers. The create_function function gives the code the ability to run various bits of code (like a call to in_array or counting the values in an array).
</p>]]></description>
      <pubDate>Fri, 18 May 2007 16:27:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Metapundit.net: Partial function application in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7273</guid>
      <link>http://www.phpdeveloper.org/news/7273</link>
      <description><![CDATA[<p>
On the Metapundit.net site, there's <a href="http://metapundit.net/sections/blog/166">a new (long) entry</a> that takes a look at one of the programming styles, functional programming, and checks into its support in PHP. Unfortunately, it's mostly a swing and a miss.
</p>
<blockquote>
I should just get this straight right off the bat: you can't really do much <a href="http://en.wikipedia.org/wiki/Functional_programming">functional programing</a> in PHP. Functions are not first class citizens and the equivalent of passing functions around is passing around strings or arrays and relying on convention. <a href="http://us2.php.net/manual/en/language.pseudo-types.php">No really</a>.
</blockquote>
<p>
He <a href="http://metapundit.net/sections/blog/166">goes on</a> by illustrating the point that PHP can do this sort of thing but only up to a point. Once you start to get into anonymous functions and moving past things like the array_map function, you start to loose a foothold. The create_function function allows for a bit more flexibility, but still doesn't fulfill the requirements needed for full support. 
</p>]]></description>
      <pubDate>Wed, 14 Feb 2007 07:54:00 -0600</pubDate>
    </item>
  </channel>
</rss>
