<?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>Wed, 19 Jun 2013 04:35:14 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Phil Sturgeon: PHP 6: Pissing in the Wind]]></title>
      <guid>http://www.phpdeveloper.org/news/19097</guid>
      <link>http://www.phpdeveloper.org/news/19097</link>
      <description><![CDATA[<p>
With some of the recent talk about the consistency of naming methods in PHP (or <a href="http://phpdeveloper.org/news/19091">lack thereof</a>) <i>Phil Sturgeon</i> has put together some ideas about why this (and unicode) changes aren't happing in the language.
</p>
<blockquote>
PHP is well known for having an inconsistent API when it comes to PHP functions. Anyone with an anti-PHP point of view will use this as one of their top 3 arguments for why PHP sucks, while most PHP developers will point out that they don't really care. [...] Another big thing that anti-PHP folks laugh about is the lack of scalar objects, so instead of $string->length() you have to do strlen($string). ANOTHER thing that people often joke about is how PHP 6.0 just never happened, because the team were trying to bake in Unicode support but just came across so many issues that it never happened.
</blockquote>
<p>
He shares an "obvious answer" to the problems and shares a theory as to why it's not happening - that no one is really working on out (outisde of <a href="https://github.com/nikic/scalar_objects">this POC</a>) and some of the handling with the recent property accessors <a href="https://wiki.php.net/rfc/propertygetsetsyntax-v1.2#voting">RFC</a>. He finishes off the post with three more points, all related to the results of the voting - little points seem to get voted in easier, the representation of developers in the process and that at least one of the "no" votes had to do with not wanting to maintain the results.
</p>
<blockquote>
Making changes to this language should not be blocked just because a quiet minority of the core team don't like the idea of being asked to do stuff.
</blockquote>
<p>
Be sure to check out <a href="http://philsturgeon.co.uk/blog/2013/01/php-6-pissing-in-the-wind#comments">the comments</a> on the post - there's lots of them, so be sure you have some good time to read.
</p>]]></description>
      <pubDate>Mon, 28 Jan 2013 10:42:16 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPClasses.org: The Secret PHP Optimization of version 5.4]]></title>
      <guid>http://www.phpdeveloper.org/news/18094</guid>
      <link>http://www.phpdeveloper.org/news/18094</link>
      <description><![CDATA[<p>
In <a href="http://www.phpclasses.org/blog/post/187-The-Secret-PHP-Optimization-of-version-54.html">this new post</a> from <i>Manuel Lemos</i> on the PHPClasses.org blog about some of the performance enhancements that were introduced in the latest PHP releases (the 5.4.x series) including variable access optimization.
</p>
<blockquote>
PHP 5.4 introduced several performance optimizations. One of them was not discussed much in the PHP community but it may affect the performance of your code depending on the way you write it.
</blockquote>
<p>
He gets into some of the details surrounding the variable access optimization, pointing out how to get the most out of this improvement. He also does a bit of speculation about future versions of the language, including the possible introduction of <a href="http://www.phpclasses.org/blog/post/117-PHP-compiler-performance.html">"Just In Time" compilers</a>.
</p>]]></description>
      <pubDate>Thu, 14 Jun 2012 12:12:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Metatesting: Extending Your Testing Tools]]></title>
      <guid>http://www.phpdeveloper.org/news/17851</guid>
      <link>http://www.phpdeveloper.org/news/17851</link>
      <description><![CDATA[<p>
<i>Chris Hartjes</i> has had a few posts about "metatesting" already and in <a href="http://www.littlehart.net/atthekeyboard/2012/04/19/metatesting-extending-your-testing-tools/">this latest article</a> he takes the series one more step. He looks at moving outside of the current toolset and expanding on them to meet your testing needs.
</p>
<blockquote>
While <a href="http://phpunit.de/">PHPUnit</a> is awesome out of the box, it still lacks some tools that are required to do things like test protected class methods or assign values to protected class attributes. Lucky for me we have an awesome testing engineer at Kaplan named <a href="https://twitter.com/FreshWillisms">Will Parker</a> who has shown me some ways that they have extended PHPUnit itself to make testing certain things easier.
</blockquote>
<p>
<i>Chris</i> talks about things like testing protected methods (easy thanks to a helper) and checking the value of a class property. The key to both of them lies in using PHP's own <a href="http://php.net/reflection">Reflection</a> functionality to alter properties on the class objects themselves.
</p>]]></description>
      <pubDate>Mon, 23 Apr 2012 11:27:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Josh Adell's Blog: GetSet Methods vs. Public Properties]]></title>
      <guid>http://www.phpdeveloper.org/news/17623</guid>
      <link>http://www.phpdeveloper.org/news/17623</link>
      <description><![CDATA[<p>
<i>Josh Adell</i> has a new post to his blog talking about a debate between developers over which is the better method - <a href="http://blog.everymansoftware.com/2012/03/getset-methods-vs-public-properties.html">using public properties or getters and setters</a> to work with values on your objects.
</p>
<blockquote>
I was recently having a debate with a coworker over the utility of writing getter and setter methods for protected properties of classes. On the one hand, having getters and setters seems like additional boilerplate and programming overhead for very little gain. On the other hand, exposing the value properties of a class seems like bad encapsulation and will overall lead to code that is more difficult to maintain. I come down firmly on the get/set method side of the fence. 
</blockquote>
<p>
In his opinion, the getter/setter method provides an explicit interface to the class that describes what it can do and how you can work with it. He gives code examples, comparing the two methods - simple setting of properties on one object and using get*/set* methods on the other. He brings up the point that, if ever in the future you wanted to handle the data for a property differently, say always make it an array or object. He also points out that this still doesn't prevent the setting of new properties directly, so he uses the magic __get and __set to deal with that.
</p>]]></description>
      <pubDate>Mon, 05 Mar 2012 09:50:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Freek Lijten's Blog: Currently on PHP's internals - Property Accessors]]></title>
      <guid>http://www.phpdeveloper.org/news/17493</guid>
      <link>http://www.phpdeveloper.org/news/17493</link>
      <description><![CDATA[<p>
<i>Freek Lijten</i> has <a href="http://www.freeklijten.nl/home/2012/02/02/Currently-on-PHPs-internals-Property-Accessors">posted another</a> "Currently on PHP's internals..." post to his blog today (<a href="http://phpdeveloper.org/news/16476">here's</a> the previous one) with a look at the discussions around the idea of having "property accessors" in PHP - a standardized way of defining getters/setters in objects.
</p>
<blockquote>
 Today I will be discussing a feature that at this moment is called "Property Accessor". It is a method of defining getters and setters. Originally an RFC was defined as early as september 2009, but recently new discussion took place and an actual patch was created. There is no certainty this feature will ever make a PHP version but discussion seems to target implementation details and not the feature itself, so things are looking bright for this feature.
</blockquote>
<p>
There's two RFCs posted about the topic - <a href="https://wiki.php.net/rfc/propertygetsetsyntax">the original proposal</a> (from <i>Dennis Robinson</i>) and <a href="https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented">a patch</a> for implementing them (from <i>Clint Priest</i>). The proposal replaces the common magic getters/setters (__get & __set) with the optional "get" and "set" keywords inside of custom-defined properties.
</p>]]></description>
      <pubDate>Fri, 03 Feb 2012 09:39:14 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Proxies in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16555</guid>
      <link>http://www.phpdeveloper.org/news/16555</link>
      <description><![CDATA[<p>
In a new blog post <i>Matthew Weier O'Phinney</i> has <a href="http://weierophinney.net/matthew/archives/263-Proxies-in-PHP.html">taken a look at proxy objects</a> (the Proxy design pattern) and how it differs from some of the other popular patterns.
</p>
<blockquote>
Of the other patterns mentioned, the one closest to the Proxy is the Decorator. In the case of a Decorator, the focus is on adding functionality to an existing object -- for instance, adding methods, processing input before delegating to the target object, or filtering the return of a method from a target object.
</blockquote>
<p>
Proxies stand in for objects and have several benefits for your application that may or may not need all of the overhead a full object could cause. <i>Matthew</i> focuses on one benefit in particular - consuming and controlling access to another object. He sets up a problem of wanting to use properties/methods on objects that aren't exposed directly (like a protected method). His solution is a proxy layer class on top of the original object. He includes a few "gotchas" to look out for when using this technique including overwriting all necessary methods and copying over all of the needed properties.
</p>]]></description>
      <pubDate>Wed, 06 Jul 2011 08:10:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Shawn Stratton's Blog: Accesors and Religion]]></title>
      <guid>http://www.phpdeveloper.org/news/16349</guid>
      <link>http://www.phpdeveloper.org/news/16349</link>
      <description><![CDATA[<p>
<i>Shawn Stratton</i> has a new post to his blog talking about a topic he calls "flame bait" - the use of <a href="http://www.shawnstratton.info/accesors-and-religion/">accessors in PHP applications</a> (getters and setters) to access class properties.
</p>
<blockquote>
Objects have prop­er­ties which some­times need spe­cial logic on how they are retrieved and set.  There are sev­eral solu­tions to this and every­body has a dif­fer­ent view point about which is cor­rect, none are pretty and all have draw­backs which range from writ­ing extra code, cre­at­ing some­thing that has poor exten­si­bil­ity, or has issues with con­sis­tency.  These don't even breach the issues with IDE code com­ple­tion and analy­sis.  Lets look at some of these solutions.
</blockquote>
<p>
The solutions are the direct access to the class properties (which can cause some painful inconsistencies when things get complicated) and the alternative of setting up getters/setters for everything. <i>Shawn</i>'s alternative makes use of the __get and __set magic methods to catch the property values being set and handle them correctly, developers being none the wiser.
</p>]]></description>
      <pubDate>Tue, 17 May 2011 14:46:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Cal Evans' Blog: Six ways to be a better client for your developer - Point 8]]></title>
      <guid>http://www.phpdeveloper.org/news/15957</guid>
      <link>http://www.phpdeveloper.org/news/15957</link>
      <description><![CDATA[<p>
<i>Cal Evans</i> has posted the <a href="http://blog.calevans.com/2011/02/22/six-ways-to-be-a-better-client-for-your-developer-point-8/">eighth tip</a> in his six-tip series (but who's counting) about how a client can coordinate better with a developer and make a better relationship for the project. In this new tip, he suggests that the client "own it".
</p>
<blockquote>
No, I'm not talking about own it as in Point 7 - "Do your part", I mean make sure that at the end of the project, you own the project, not your developer.
</blockquote>
<p>
He mentions two of the aspects you, the client, will need to worry about once the last line of bug free code has been committed and delivered. Be sure that you own the domain name for the project and have a clear understanding of any intellectual property concerns that might come up (what codebase is it built on, who owns the code - client or developer, etc).
</p>]]></description>
      <pubDate>Thu, 24 Feb 2011 11:03:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Label Media Blog: Design Patterns in PHP - Decorator Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/15547</guid>
      <link>http://www.phpdeveloper.org/news/15547</link>
      <description><![CDATA[<p>
<i>Tom Rawcliffe</i> has <a href="http://www.labelmedia.co.uk/blog/posts/design-patterns-decorator-pattern.html">posted the latest installment</a> of his look at design patterns in PHP. This time his focus is on the Decorator pattern.
</p>
<blockquote>
Continuing my series on PHP design patterns, today it's the turn of the Decorator. In contrast to last week's <a href="http://www.labelmedia.co.uk/blog/posts/design-patterns-strategy-pattern.html">Strategy Pattern</a> which is used to change the 'œguts' of a class, the Decorator Pattern is used to extend the behavior of a class with different functionality at run time. This is achieved by implementing a 'œdecorator' class that implements the same interface as the object that you wish to 'œdecorate' and wraps it's content.
</blockquote>
<p>
The Decorator pattern lets you "decorate" your objects with additional features. He illustrates with a sample "Property" class (that implements an interface) that he wants to extend past the normal property handling. He add a "PropertyDecorator" to the mix that lets it use deocrators for uppercasing and padding the string. There's an example script included at the end that shows how to put it all to use.
</p>]]></description>
      <pubDate>Wed, 08 Dec 2010 09:13:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Wojciech Sznapka's Blog: Accessing private object property from other object in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15439</guid>
      <link>http://www.phpdeveloper.org/news/15439</link>
      <description><![CDATA[<p>
<i>Wojciech Sznapka</i> has a new post to his blog showing an interesting OOP programming strick related to <a href="http://blog.sznapka.pl/accessing-private-object-property-from-other-object/">accessing private properties</a> in one object from another if they're derived from the same class.
</p>
<blockquote>
Last time I wrote about <a href="http://blog.sznapka.pl/weirdest-php-construction-ive-ever-seen/">Weirdest PHP construction I've ever seen</a>, now I found another unusual PHP solution. PHP offers 3 visibility modifiers: private, protected and public. Private properties and methods can't be accessed outside the object, as well as from inherited classes. With one exception... They can be accessed by other instances of the same class. You can read more about it in the <a href="http://www.php.net/manual/en/language.oop5.visibility.php#language.oop5.visibility-other-objects">PHP manual</a>.
</blockquote>
<p>
In his code example he shows how to create two objects of the Foo class and, using getters and setters change the value of a private property from the first object on the second object.
</p>]]></description>
      <pubDate>Tue, 16 Nov 2010 12:25:53 -0600</pubDate>
    </item>
  </channel>
</rss>
