<?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>Thu, 20 Nov 2008 03:30:47 -0600</pubDate>
    <ttl>30</ttl>
    <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[Michael Kimsal's Blog: Lessons learned from a reddit overload]]></title>
      <guid>http://www.phpdeveloper.org/news/10511</guid>
      <link>http://www.phpdeveloper.org/news/10511</link>
      <description><![CDATA[<p>
Thanks to it being posted on <a href="http://www.reddit.com/">reddit</a>, the traffic to a <a href="http://michaelkimsal.com/blog/why-do-browsers-still-not-have-file-upload-progress-meters/">certain post</a> on <i>Michael Kimsal</i>'s blog gave him a crash (literally?) course in high load management on a WordPress blog.
</p>
<blockquote>
The blog post was voted up on reddit, and the server got slammed.  So slammed, in fact, that it was unusable for a few hours while I investigated the problem.  I didn't know the post was on reddit, but I knew I was getting some traffic. 
</blockquote>
<p>
He spent some time trying to get the Apache server to finally die off and give him back his machine, at least enough to get a feel for what was going on. Part of his problem was not having APC installed like he thought and the other part - <a href="http://www.wordpress.org">WordPress</a>. While friendly on the outside, it's apparently somewhat lacking on the inside. 
</p>]]></description>
      <pubDate>Mon, 30 Jun 2008 12:04:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney's Blog: Overloading arrays in PHP 5.2.0]]></title>
      <guid>http://www.phpdeveloper.org/news/7129</guid>
      <link>http://www.phpdeveloper.org/news/7129</link>
      <description><![CDATA[<p>
In <a href="http://weierophinney.net/matthew/archives/131-Overloading-arrays-in-PHP-5.2.0.html">a new post</a> to his blog, <i>Matthew Weir O'Phinney</i> talks about a method for overloading arrays in a script written for the PHP 5.2 series.
</p>
<blockquote>
<p>
Several weeks back, a bug was reported against <a href="http://framework.zend.com/manual/en/zend.view.html">Zend_View</a> that had me initially stumped. [...] I'd read about this some months back on the php internals list, but at the time hadn't understood the consequences. 
</p>
<p>
Basically, __get() no longer returns a reference and returns values in read mode, which makes modifying arrays using overloading impossible using traditional methods.
</p>
</blockquote>
<p>
Unfortunately, this was exactly the functionality that was needed, so <i>Matthew</i> <a href="http://weierophinney.net/matthew/archives/131-Overloading-arrays-in-PHP-5.2.0.html">set out</a> to find a way to do just that. His initial method, extending the ArrayObject, worked but still gave errors. On <a href="http://mikenaberezny.com/">Mike Naberezny</a>'s recommendation, though, this too was resolved with a simple call to the __set method instead.
</p>]]></description>
      <pubDate>Sat, 19 Jan 2008 08:01:25 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney's Blog: Overloading arrays in PHP 5.2.0]]></title>
      <guid>http://www.phpdeveloper.org/news/6993</guid>
      <link>http://www.phpdeveloper.org/news/6993</link>
      <description><![CDATA[<p>
<i>Matthew Weir O'Phinney</i> has a new post on his blog today talking about <a href="http://weierophinney.net/matthew/archives/131-Overloading-arrays-in-PHP-5.2.0.html">overloading arrays</a> in PHP 5.2.0 using the magic __get and __construct functions.
</p>
<blockquote>
Several weeks back, a bug was reported against <a href="http://framework.zend.com/manual/en/zend.view.html">Zend_View</a>  that had me initially stumped. [...] Basically, __get() no longer returns a reference and returns values in read mode, which makes modifying arrays using overloading impossible using traditional methods.
</blockquote>
<p>
He <a href="http://weierophinney.net/matthew/archives/131-Overloading-arrays-in-PHP-5.2.0.html">gives a code example</a> of the problem and two ways to get around it - one using a switch statement to get around the problem and the other ("best solution") was <i>Matthew</i>'s option to extend the ArrayObject class.
</p>]]></description>
      <pubDate>Fri, 29 Dec 2006 07:33:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mike Wallner's Blog: __get() and array rumors]]></title>
      <guid>http://www.phpdeveloper.org/news/6090</guid>
      <link>http://www.phpdeveloper.org/news/6090</link>
      <description><![CDATA[<p>
In <a href="http://blog.iworks.at/?/archives/47-__get-and-array-rumors.html">a brief new post</a>, <i>Mike Wallner</i> talks about some of the discussion surrounding overloaded array properties lately and something he's discovered about it.
</p>
<blockquote>
As arrays are the only complex types that are passed by value (resources don't really count here) the solution to described problem is simple: use an object; either an instance of stdClass or ArrayObject will do well, depending if you want to use array index notation.
</blockquote>
<p>
He <a href="http://blog.iworks.at/?/archives/47-__get-and-array-rumors.html">includes two code examples</a>, one just trying to overload it in a class with __get (yielding an error) and the other using the constructor to pass an ArrayObject out first, allowing for error-free assignment.
</p>]]></description>
      <pubDate>Mon, 21 Aug 2006 07:49:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Overloaded properties (__get)]]></title>
      <guid>http://www.phpdeveloper.org/news/6085</guid>
      <link>http://www.phpdeveloper.org/news/6085</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> talks about something he noticed when working with backwards compatibility to PHP 5.1 for the <a href="http://components.ez.no/">eZ components</a> project - the first of which is that <a href="http://derickrethans.nl/overloaded_properties_get.php">__get doesn't behave itself in some situations</a>.
</p>
<blockquote>
<p>
The first issue is an extra notice in some cases. In our (ezcMailTools) class we implement a method that allows you to "reply" to a parsed e-mail message. you can see we loop over one of the seemingly public variables of the $mail class. However, the ezcMail class does not have this as a public member variable, but instead uses overload.
</p>
<p>
This all works 'fine' with PHP 5.1, however with PHP 5.2 the following notice was generated for this code:
</p>
<p>
Notice: Indirect modification of overloaded property ezcMail::$to has no effect in ../Mail/src/tools.php on line 364
</p>
<p>
The reason for this is that __get() only returns variables in read mode, while foreach() wants a variable in read/write mode as it tries to modify the internal array pointer. As it can't do this PHP 5.2 will now throw a warning on this. 
</p>
</blockquote>
<p>
The mentioned <a href="http://derickrethans.nl/overloaded_properties_get.php">code examples are included</a> and he includes the work-around that he found to help keep the issue from popping up again.
</p>]]></description>
      <pubDate>Sat, 19 Aug 2006 15:29:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Implementing Property Overloading in PHP 4]]></title>
      <guid>http://www.phpdeveloper.org/news/5771</guid>
      <link>http://www.phpdeveloper.org/news/5771</link>
      <description><![CDATA[<p>
There's been a lot of fuss about the new object model in PHP5 lately, but what's a developer to do when he's stuck back in PHP4 and has no control over when things are updated? Do you just miss out on some of those cool features? Well, you may not have access to what PHP5-ers do, but PHP4 still has some cool tricks up its sleeve. One of which is property overloading, and it's covered in <a href="http://www.devshed.com/c/a/PHP/Implementing-Property-Overloading-in-PHP-4/">this new article</a> from DevShed.
</p>
<blockquote>
In these articles, I'll explain the basics of class overloading, starting with the application of the "overload()" function in PHP 4, in conjunction with using the "_set()", "__get()" and "__call()" methods, accompanied of several practical examples, so you'll have a clear idea of how to overload your classes. Also, I'll cover class overloading in PHP 5, which offers native support for overloading methods and properties through the built-in methods that I mentioned before.
</blockquote>
<p>
<a href="http://www.devshed.com/c/a/PHP/Implementing-Property-Overloading-in-PHP-4/">This first part</a> of the series lays down the groundwork of overloading, touching briefly on its uses before moving onto some of the functionality - the __set method, overload function, and __get method - to make a simple "cookie saver" application.
</p>]]></description>
      <pubDate>Tue, 11 Jul 2006 09:13:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Elizabeth Smith's Blog: String Class (Kal_String)]]></title>
      <guid>http://www.phpdeveloper.org/news/4772</guid>
      <link>http://www.phpdeveloper.org/news/4772</link>
      <description><![CDATA[On her blog today, <i>Elizabeth Smith</i> has <a href="http://elizabethmariesmith.com/2006/01/31/string-class/">this new post</a> highlighting a string class that she's created to overload the basic PHP types to handle multibyte or translated strings.
<p>
<quote>
<i>
So my rather cumbersome three classes to handle translation and charsets is now ONE class. When the rest of the magic __toString stuff goes into php (estimated for 5.2, which I wouldn't know if I didn't read internals religiously) it makes it even easier to use.
<p>
<a href="http://websvn.bluga.net/wsvn/Kalfu/trunk/kalfu/lib/string.class.php?op=file&rev=0&sc=0">Kal_String</a> is the class itself. Basically it has TWO constructors - because there are a series of static settings and two static methods that deal with things like a default charset to use for all strings and a default language to look for. The language searching is set up with a callback - so you can write your own class using gettext or including straight php files or whatever you want. You can even manually load in translation strings for individual string instances if you're so inclined.
</i>
</quote>
<p>
She <a href="http://elizabethmariesmith.com/2006/01/31/string-class/">gives examples</a> of how to use the class, everything from just a simple output to the use of some of the more advanced "interpretation"-based features.]]></description>
      <pubDate>Wed, 01 Feb 2006 06:48:47 -0600</pubDate>
    </item>
  </channel>
</rss>
