<?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, 12 Feb 2012 21:18:14 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Runtime Classes. A experiment with PHP and Object Oriented Programming]]></title>
      <guid>http://www.phpdeveloper.org/news/16684</guid>
      <link>http://www.phpdeveloper.org/news/16684</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has put together an experiment related to the current OOP structure of PHP - a test <a href="http://gonzalo123.wordpress.com/2011/08/08/runtime-classes-a-experiment-with-php-and-object-oriented-programming/">working with runtime classes</a>, a structure generated entirely when the script is executed and not predefined in the file.
</p>
<blockquote>
Last week I was thinking about creation of a new type of classes. PHP classes but created dynamically at run time. When this idea was running through my head I read the following <a href="http://dhotson.tumblr.com/post/1167021666/php-object-oriented-programming-reinvented">article</a> and I wanted to write something similar. Warning: Probably that it is something totally useless, but I wanted to create a working prototype (and it was fun to do it).
</blockquote>
<p>
His class is pretty basic - a "Human" object that echoes a "hello world" sort of message via a "hello()" method. He creates the classes inside of different test methods to ensure that his assertions are true. The tests check basic output of the "hello()" method, calling undefined methods, testing inheritance and a test creating and evaluating a dynamic function.
</p>
<p>
For something more complex, he creates a dynamic class that solves the <a href="http://codingdojo.org/cgi-bin/wiki.pl?KataFizzBuzz">FizzBuzz</a> kat, a popular programming puzzle. You can find the full code for this and his other examples <a href="https://github.com/gonzalo123/HClass">on github</a>.
</p>]]></description>
      <pubDate>Mon, 08 Aug 2011 09:17:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[RubySource.com: Confessions of a Converted PHP Developer: Animal Abuse]]></title>
      <guid>http://www.phpdeveloper.org/news/16523</guid>
      <link>http://www.phpdeveloper.org/news/16523</link>
      <description><![CDATA[<p>
In another entry in his "Confessions of a Converted PHP Developer" series <i>Mal Curtis</i> about a <a href="http://rubysource.com/confessions-of-a-converted-php-developer-animal-abuse/">typical class development path</a> PHP developers take and how it can be a limiting, linear progression from one step to another.
</p>
<blockquote>
In converting to Ruby I realized how strict PHP is in its class hierarchy. This surprised me as I'd always viewed PHP as a very loose language, mainly due to its loose typing and lack of formal code structure guidelines. [...] I find most PHP developers learn starting by using inline PHP as a low learning curve entry point into dynamic web languages and then move on to fuller, more complex, applications.
</blockquote>
<p>
He includes a few code samples comparing how Ruby, while still allowing the same kind of structure, also lets you redefine classes on the fly. His example shows redefining a method in a Ruby class using a method commonly called "monkey patching". It's good that he points out a downfall of the approach too:
</p>
<blockquote>
I must note that Monkey Patching is often a quick fix solution that can create headaches for future developers (or for yourself, if your memory is like mine) for several reasons. [...] Use at your own risk! 
</blockquote>
<p>
There's <a href="http://www.google.com/#sclient=psy&hl=en&authuser=0&source=hp&q=monkey+patch+php">several different articles</a> all over the web talking about the "monkey patching" approach and if it's possible/useful in PHP.
</p>]]></description>
      <pubDate>Mon, 27 Jun 2011 13:40:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Slawek Lukasiewicz's Blog: Working with date and time in object oriented way]]></title>
      <guid>http://www.phpdeveloper.org/news/16451</guid>
      <link>http://www.phpdeveloper.org/news/16451</link>
      <description><![CDATA[<p>
<i>Slawek Lukasiewicz</i> has a new post today about <a href="http://www.leftjoin.net/2011/06/working-with-date-and-time-in-object-oriented-way/">working with dates and times in PHP</a> on a more object-oriented fashion than in the more traditionally procedural way of just calling PHP date/time functions on the string values.
</p>
<blockquote>
Date and time manipulation in PHP is mostly connected with functions like: date, time or strtotime. They can be sufficient, but if we want to deal with dates like with objects - we can use DateTime class. DateTime class is not only straightforward wrapper for standard functions, it has a lot of additional features - for example timezones.
</blockquote>
<p>
He shows how to use the <a href="http://php.net/datetime">DateTime</a> functionality to return an object you can call several different methods on. He gives examples of the formatting call, comparing one DateTime object to another, how to update the date after the object's created, calculating the difference between two dates and iterating through a certain time period.
</p>]]></description>
      <pubDate>Fri, 10 Jun 2011 08:13:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Elated.com: Object-Oriented PHP: Working with Inheritance]]></title>
      <guid>http://www.phpdeveloper.org/news/16391</guid>
      <link>http://www.phpdeveloper.org/news/16391</link>
      <description><![CDATA[<p>
On Elated.com there's a new <a href="http://www.elated.com/articles/object-oriented-php-working-with-inheritance/">introduction to working with inheritance in PHP</a> for object-oriented applications. They work through some of the basic concepts including parent/child classes, final and abstract classes and interfaces.
</p> 
<blockquote>
In this article we're going to explore the idea of inheritance in object-oriented programming, and how inheritance works in PHP. With inheritance, your objects and classes can become much more powerful and flexible, and you can save a lot of time and effort with your coding.
</blockquote>
<p>
They start with the basics of how inheritance works and then move right into creating child classes from a parent. Their example code makes a basic forum system (just example code, not fully functioning) with administrators, members and forum creation. They use this as a base to show the method overriding and exposure with "final". The finish it off with examples of two things that can promote good application structure - abstract classes an interfaces.
</p>]]></description>
      <pubDate>Fri, 27 May 2011 09:21:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Web Developer Juice: PHP Magic Functions: Best Part of Object Oriented PHP - Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/16288</guid>
      <link>http://www.phpdeveloper.org/news/16288</link>
      <description><![CDATA[<p>
On the Web Developer Juice blog there's a <a href="http://www.webdeveloperjuice.com/2011/04/28/php-magic-functions-best-part-of-object-oriente-php/">recent post</a>, the first part in a series</a> looking at one of the more handy features of the recent releases of PHP - the magic functions (some which were added in the PHP 5.x series).
</p>
<blockquote>
There are some reserved function names  in PHP class starting with __ ( double underscore ). These are <a href="http://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor">__construct</a>, <a href="http://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.destructor">__destruct</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">__isset</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">__unset</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods">__call</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods">__callStatic</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep">__sleep</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep">__wakeup</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">__get</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">__set</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring">__toString</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.set-state">__set_state</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.invoke">__invoke</a> and <a href="http://www.php.net/manual/en/language.oop5.cloning.php">__clone</a>. You cannot use these functions to serve your logical purpose but these are meant to be used for providing magic functionality.
</blockquote>
<p>
They go through some of the above methods and talk about what role they can play in your code and, for some, a brief bit of code to explain how it works. This first part covers __construct/__destruct and __call/__callStatic.
</p>]]></description>
      <pubDate>Tue, 03 May 2011 11:57:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Web Builder Zone: The PHP paradigms poll results: OOP wins]]></title>
      <guid>http://www.phpdeveloper.org/news/15231</guid>
      <link>http://www.phpdeveloper.org/news/15231</link>
      <description><![CDATA[<p>
According to <a href="http://css.dzone.com/articles/php-paradigms-poll-results-oop">this new post</a> on the Web Builder Zone, the results of a poll taken about the best programming method for PHP these days is - by far - object-oriented programming.
</p>
<blockquote>
After two weeks of gathering votes, the PHP paradigms poll is now closed. With 216 votes (73%), the winner paradigm in popularity is Object-Oriented Programming. The old procedural approach to PHP, which has given fame to Wordpress and Drupal, is coming to an end. Even Drupal 7 has an object-oriented database layer as a primary component, and this paradigm is by far the most diffused in the world for web sites and applications written in high level languages (different from C).
</blockquote>
<p>
While the overwhelming amount of votes went to OOP, there were still a few for some of the other options including the second place winner - procedural programming. He also talks a bit about OOP's current place in the PHP ecosystem and how it has allowed for certain great tools to be developed, but how it also has a good ways to go in functionality.
</p>]]></description>
      <pubDate>Tue, 05 Oct 2010 11:21:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Giorgio Sironi's Blog: Missing the point (OOP in scripting languages)]]></title>
      <guid>http://www.phpdeveloper.org/news/14867</guid>
      <link>http://www.phpdeveloper.org/news/14867</link>
      <description><![CDATA[<p>
On his blog today <i>Giorgio Sironi</i> has a response to <a href="http://phpdeveloper.org/news/14851">this post</a> from the I Am Learning PHP blog asking if web scripting languages really need OOP functionality.
</p>
<blockquote>
Yesterday I came across a question: <a href="http://iamlearningphp.blogspot.com/2010/07/do-web-scripting-languages-really-need.html">Do Web-Scripting Languages Really Need OOP?</a> Here's my answer: only if you want to do more than an Hello World script (which is paradoxically how old school programmers measure the utility of a language.) I'll express some of my thoughts without compromises, which will be up to you.
</blockquote>
<p>
He opposes the claims of the other post, noting that there's a reason most PHP frameworks are object-oriented and his concern with some of the comments on the post. He also responds to two of the comments on the post - one about the private scope and the other about namespaces.
</p>]]></description>
      <pubDate>Thu, 29 Jul 2010 08:49:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: Object-Oriented PHP for Beginners ]]></title>
      <guid>http://www.phpdeveloper.org/news/14768</guid>
      <link>http://www.phpdeveloper.org/news/14768</link>
      <description><![CDATA[<p>
If you're just making the move from procedural PHP development into the next level - object oriented programming - and are having a bit of trouble getting the hang of it, you might want to <a href="http://net.tutsplus.com/tutorials/php/object-oriented-php-for-beginners">read this new tutorial</a> from NETTUS.com introducing the topic.
</p>
<blockquote>
For many PHP programmers, object-oriented programming is a frightening concept, full of complicated syntax and other roadblocks. As detailed in my book, <a href="http://www.amazon.com/gp/product/1430228474">Pro PHP and jQuery</a>, you'll learn the concepts behind object-oriented programming (OOP), a style of coding in which related actions are grouped into classes to aid in creating more-compact, effective code. 
</blockquote>
<p>
He introduces the concepts behind objects and working with them in your code first then moves into how they relate to classes (with a housing metaphor). He talks about class structure, properties, methods (both magic and user-defined) as well as using __toString, visibility and using DocBlock comments in your code. They also have a comparison between procedural code and object-oriented code in the form of a few reasons to lean towards OOP.
</p>]]></description>
      <pubDate>Fri, 09 Jul 2010 08:56:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Three Advanced Object-Oriented PHP Features You Need to Know ]]></title>
      <guid>http://www.phpdeveloper.org/news/14657</guid>
      <link>http://www.phpdeveloper.org/news/14657</link>
      <description><![CDATA[<p>
On PHPBuilder.com there's a <a href="http://www.phpbuilder.com/columns/Jason_Gilmore061510.php3">new article on OOP</a> in PHP applications, specifically some of the things that PHP5 has to offer you if you're not using it to its fullest potential.
</p>
<blockquote>
I'll introduce you to three of PHP's advanced object-oriented features which seem to not have garnered the attention they deserve. The topics discussed here should be useful whether you're a relative newcomer to object-oriented development and are looking to expand your knowledge, or have a background using languages such as Java or C# and are trying to learn more about what PHP has to offer.
</blockquote>
<p>
These three things he introduces are Reflection (PHP's <a href="http://us2.php.net/reflection">API for introspection</a> of code), the SPL (Standard PHP Library) set of objects and tools and a more recent addition - late static binding.
</p>]]></description>
      <pubDate>Wed, 16 Jun 2010 09:13:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ibuildings Blog: Migrating a dev team to an OO team (Part 2)]]></title>
      <guid>http://www.phpdeveloper.org/news/14327</guid>
      <link>http://www.phpdeveloper.org/news/14327</link>
      <description><![CDATA[<p>
In the second part of his look at migrating procedural teams to being object-oriented (the first part was a while back - <a href="http://www.ibuildings.co.uk/blog/archives/1567-Migrating-a-dev-team-to-an-OO-team-Part-1.html">six months ago</a>) <i>Dennis-Jan Broerse</i> comes back with <a href="http://www.ibuildings.co.uk/blog/archives/1568-Migrating-a-dev-team-to-an-OO-team-Part-2.html">ten steps</a> you can follow to be sure it's the right move to make and and to help the transition along.
</p>
<blockquote>
After reading all the insightful comments on that post I've compiled a list with 10 steps to migrate your development team to an OO development team successfully. [...] With these 10 steps you are able to successfully migrate your team from a procedural team to an effective OO team.
</blockquote>
<p>
The steps in the process are all important in their own right - things like "Ask yourself why you want to migrate", "Make a plan" and "Make some resources available" are important for starting out but doing the work and handling the aftermath are just as important. He recommends you "Document the lessons learned" and "spread the knowledge" out amongst the team for the best results.
</p>]]></description>
      <pubDate>Fri, 09 Apr 2010 11:41:44 -0500</pubDate>
    </item>
  </channel>
</rss>

