<?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>Fri, 29 Aug 2008 03:56:09 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Daniel Cousineau's Blog: PHP Women Best Practice Contest Posts]]></title>
      <guid>http://www.phpdeveloper.org/news/10732</guid>
      <link>http://www.phpdeveloper.org/news/10732</link>
      <description><![CDATA[<p>
<i>Daniel Cousineau</i> <a href="http://www.toosweettobesour.com/2008/07/31/php-women-best-practice-contest-posts/">posted copies</a> of his submissions to the <a href="http://www.phpwomen.org">PHP Women</a> group's Article Contest (Best Practices) that finishes up today.
</p>
<blockquote>
I made a few posts to the PHPWomen.org <a href="http://www.phpwomen.org/wordpress/2008/06/24/phpwomen-article-competition/">Article Competition</a> and felt I should share them here.
</blockquote>
<p>His three submissions are:</p>
<ul>
<li><a href="http://www.toosweettobesour.com/2008/07/31/php-women-best-practice-contest-posts/#flash-your-errors">Flash Your Errors: It's Illegal In 28 States!</a> on combining flash messages and error reporting 
<li><a href="http://www.toosweettobesour.com/2008/07/31/php-women-best-practice-contest-posts/#magical-autoload">David Copperfield Wasn't This __magical: __autoload() is Awesome!</a> on using the __autoload functions and PEAR style namespacing 
<li><a href="http://www.toosweettobesour.com/2008/07/31/php-women-best-practice-contest-posts/#path-secrets">Path Secrets Of The Most Awesome</a> on making your path operations indestructible across operating systems. 
</ul>
<p>
There's still (a little) time to get your own submission in to <a href="http://www.phpwomen.org/wordpress/2008/06/24/phpwomen-article-competition/">the contest</a> to get over and submit your article for your chance to win a copy of Zend Studio and maybe get your article featured in Linux Pro Magazine.
</p>]]></description>
      <pubDate>Thu, 31 Jul 2008 16:09:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Eran Gelperin's Blog: Operator overloading in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10562</guid>
      <link>http://www.phpdeveloper.org/news/10562</link>
      <description><![CDATA[<p>
<i>Eran Gelperin</i> gives <a href="http://www.techfounder.net/2008/07/08/operator-overloading-in-php/">an overview</a> of the current state of overloading abilities PHP has in a new blog post today:
</p>
<blockquote>
<a href="http://en.wikipedia.org/wiki/Operator_overloading">Operator overloading</a> is a programming language features that allows operators to act differently depending on the type of data they are operating on. Since OOP lets us create custom types (classes), there are plenty of opportunities to do useful and interesting code manipulations using operator overloading.
</blockquote>
<p>
He talks about <a href="http://www.php.net/oop5.magic">magic functions</a>, the additions that the <a href="http://www.php.net/~helly/php/ext/spl/">SPL</a> made, the PECL addition <a href="http://pecl.php.net/package/operator">operator</a> and how much its <a href="http://blog.phpdoc.info/archives/2-PHP-5.1-Babble.html">currently being discussed</a> on the PHP internals list.
</p>]]></description>
      <pubDate>Tue, 08 Jul 2008 10:29:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SaniSoft Blog:  The prefix automagic in CakePHP routing]]></title>
      <guid>http://www.phpdeveloper.org/news/9941</guid>
      <link>http://www.phpdeveloper.org/news/9941</link>
      <description><![CDATA[<p>
On the SaniSoft blog, <i>Tarique Sani</i> <a href="http://www.sanisoft.com/blog/2008/04/04/the-prefix-automagic-in-cakephp-routing/">talks briefly</a> about some of the prefix "automagic" that's already built in to the CakePHP framework's routing.
</p>
<blockquote>
There are times when you need more than just admin routing, how about something like http://blah.com/user/profiles/edit and http://blah.com/user/profiles/changepassword ? If this could be routed to an action like user_add and user_changepassword wouldn't it be great!! (eg: think ownership ACL checks)
</blockquote>
<p>
Good thing the CakePHP developers already planned for something like this - they included the connect() method for Router objects that maps the URL request to a method with that same prefix in the controller.
</p>]]></description>
      <pubDate>Wed, 09 Apr 2008 13:06:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lars Strojny's Blog: New magic constant in PHP 5.3]]></title>
      <guid>http://www.phpdeveloper.org/news/9691</guid>
      <link>http://www.phpdeveloper.org/news/9691</link>
      <description><![CDATA[<p>
In <a href="http://usrportage.de/archives/878-New-magic-constant-in-PHP-5.3.html">this new blog post</a> today, <i>Lars Strojny</i> talks about a new magic constant that will be joining its brothers in the upcoming PHP 5.3 release - __DIR__.
</p>
<blockquote>
In PHP 5.3 there will be another magic constant __DIR__. [...] To allow this, the internal function php_dirname() has been moved in the Zend Engine and is now called zend_dirname(). Nevertheless an alias still exists.
</blockquote>
<p>
__DIR__ will join the other constants (like __LINE__ and __FUNCTION__) to help give the currently running script a little introspection for things like its filename, what class it's currently in and now, what directory the file currently lives in.
</p>]]></description>
      <pubDate>Fri, 22 Feb 2008 15:02:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Larry Garfield's Blog: Benchmarking magic]]></title>
      <guid>http://www.phpdeveloper.org/news/9005</guid>
      <link>http://www.phpdeveloper.org/news/9005</link>
      <description><![CDATA[<p>
<i>Larry Garfield</i> has <a href="http://www.garfieldtech.com/blog/magic-benchmarks">put together some benchmarks</a> based around a request he had from other developers (the "performance czars") as to how the magic functions in PHP5 would perform in the new environment.
</p>
<blockquote>
Already, there is talk of how, and if, to leverage PHP 5's object handling now that we don't need to deal with the weirdness of PHP 4's object model. Of course, because it's Drupal, our army of performance czars want to know just what the cost is for object handling, and especially advanced object magic like __get(), __call(), the ArrayAccess interface, and so forth.
</blockquote>
<p>
He an <a href="http://www.garfieldtech.com/blog/magic-benchmarks">his tests</a> on a Thinkpad (Intel Core2 Duo 2.2Ghz) running Kubuntu and PHP 5.2.3. They were run two million times benchmarking the different methods for:
<ul>
<li>function calls 
<li>__call
<li>__get
<li>__set
<li>iterators (array)
<li>inheritance
<li>composition
</ul>
<p>
His results are listed at the <a href="http://www.garfieldtech.com/blog/magic-benchmarks">end of the post</a>.
</p>]]></description>
      <pubDate>Thu, 08 Nov 2007 12:04:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[I/O Reader: 15 Cool Things & 12 Things to Dislike About PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/8484</guid>
      <link>http://www.phpdeveloper.org/news/8484</link>
      <description><![CDATA[<p>
On the <a href="http://ioreader.com/">I/O Reader blog</a>, there's two different posts that take two sides of the spectrum when it comes to what to like and dislike about PHP, both lists of features of the the language:
</p>
<ul>
<li><a href="http://ioreader.com/2007/08/17/11-cool-things-about-php-that-most-people-overlook/">15 Cool Things About PHP That Most People Overlook</a> - a list including the Reflection API, the Standard PHP Library, type hinting and the "magic" functions.
<li><a href="http://ioreader.com/2007/08/19/12-things-you-should-dislike-about-php/">12 Things You Should Dislike About PHP</a> - this list includes things like naming conventions, that _tostring doesn't work as (he) expected, magic quotes and register globals and safe mode
</ul>
<p>
Both have their valid points and it's interesting to see how many of the points made in the first article he goes back on and mentions specific instances where it doesn't work as expected. Some of the comparisons seem a bit like he's comparing PHP to his experience in another language and not objectively on PHP's features alone.
</p>]]></description>
      <pubDate>Mon, 20 Aug 2007 08:32:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Cassell's Blog: Creating Magic Methods in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/8436</guid>
      <link>http://www.phpdeveloper.org/news/8436</link>
      <description><![CDATA[<p>
In <a href="http://www.chriscassell.net/log/2007/08/09/creating_magic_.html">this new entry</a> to his blog today, <i>Chris Cassell</i> shows how to create "magic methods" - ones that make use of overloading to do special things.
</p>
<blockquote>
I've learned a lot of things from various open source frameworks, especially CakePHP. One of the most impressive things about Cake, and Ruby on Rails for that matter, is its magic methods in its data model class [...] I've implemented similar methods in the home-grown framework that I use at work. Here's how to do it.
</blockquote>
<p>
In <a href="http://www.chriscassell.net/log/2007/08/09/creating_magic_.html">his example</a>, he gives both the PHP4 and PHP5 code to make a simple magic method class with a __call() function to handle undefined method calls. Using this, he maps a undefined method call to another method in the class (called findAllByColor and mapped to findAll with the right parameters).
</p>]]></description>
      <pubDate>Mon, 13 Aug 2007 10:21:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[WebReference.com: The Building Blocks: Data Types, Literals, Variables, and Constants - Part 3]]></title>
      <guid>http://www.phpdeveloper.org/news/7180</guid>
      <link>http://www.phpdeveloper.org/news/7180</link>
      <description><![CDATA[<p>
WebReference.com has <a href="http://www.webreference.com/programming/php/by_example3/">posted part three</a> of their "Building Blocks" series - a look at data types, literals, variables, and constants.
</p>
<p>
In part three, they focus more on the last type of "block" in their list - the constant:
</p>
<blockquote>
Some real-world constants, such as pi, the speed of light, the number of inches in a foot, and the value of midnight, are values that don't change. PHP not only provides its own predefined constants but lets you create your own. Using constants makes it easy to write and maintain your programs.
</blockquote>
<p>
There's <a href="http://www.webreference.com/programming/php/by_example3/">talk of</a> the define() and constant() functions and a mention of some of the predefined and "magic constants" as well.
</p>]]></description>
      <pubDate>Mon, 29 Jan 2007 11:44:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Overloaded properties (__get)]]></title>
      <guid>http://www.phpdeveloper.org/news/6727</guid>
      <link>http://www.phpdeveloper.org/news/6727</link>
      <description><![CDATA[<p>
While testing the <a href="http://components.ez.no/">eZ components</a> framework on the latest version of PHP (PHP 5.2), <i>Derick Rethans</i> <a href="http://derickrethans.nl/overloaded_properties_get.php">noticed a problem</a> - a new "Notice" message appearing related to a __get call.
</p>
<blockquote>
The first issue is an extra notice in some cases. This all works 'fine' with PHP 5.1, however with PHP 5.2 the [following] notice was generated for this code.
</blockquote>
<p>
The cause? Well, the magic function __get only returns the variables in read mode so they cannot be written to. In <i>Derick</i>'s situation, there was a foreach that was trying to use the values in a read/write mode. As a result, the error was tossed. He does provide a workaround, though, involving casting the information into an array.
</p>]]></description>
      <pubDate>Fri, 17 Nov 2006 08:43:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect: The Magic __set_state Method]]></title>
      <guid>http://www.phpdeveloper.org/news/5847</guid>
      <link>http://www.phpdeveloper.org/news/5847</link>
      <description><![CDATA[<p>
On php|architect's A/R/T article repository today, there's <a href="http://hades.phparch.com/ceres/public/article/index.php/art::php5::magic_set_state_method">this new tutorial</a> centered around the use of the "magic" method __set_state in PHP5.
</p>
<blockquote>
It is fairly self-evident how to use most of the magic methods of PHP 5. However, it is not quite so apparent how to use the __set_state method introduced in PHP 5.1. In this article, Peter lavin delves into this elusive magic method to show you how to use this gem in some really 'classy' object oriented PHP.
</blockquote>
<p>
The author (<i>Peter Lavin</i>) <a href="http://hades.phparch.com/ceres/public/article/index.php/art::php5::magic_set_state_method">talks first</a> about what magic methods are and, specifically, what the __set_state method can do. He gives an example, comparing a normal usage of var_export to functionality using __set_state. 
</p>]]></description>
      <pubDate>Fri, 21 Jul 2006 07:03:00 -0500</pubDate>
    </item>
  </channel>
</rss>
