<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>About Web Development by Activo &#187; method overloading</title>
	<atom:link href="http://www.activoinc.com/blog/tag/method-overloading/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.activoinc.com/blog</link>
	<description>Web Development in a Web 2.0 World</description>
	<lastBuildDate>Fri, 29 Jan 2010 17:16:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Method Overloading Workaround in PHP5</title>
		<link>http://www.activoinc.com/blog/2009/06/25/method-overloading-workaround-in-php5/</link>
		<comments>http://www.activoinc.com/blog/2009/06/25/method-overloading-workaround-in-php5/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 03:35:50 +0000</pubDate>
		<dc:creator>Ron Peled</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[method overloading]]></category>
		<category><![CDATA[Object Oriented]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.activoinc.com/blog/?p=237</guid>
		<description><![CDATA[This past week I had the need to use overloaded methods in PHP 5. Overloading a method in object oriented design is especially helpful when trying to achieve the same operation while the code needs to be triggered from different states of the application or even different locations of the application. In my case, I [...]]]></description>
			<content:encoded><![CDATA[<p>This past week I had the need to use overloaded methods in PHP 5. Overloading a method in object oriented design is especially helpful when trying to achieve the same operation while the code needs to be triggered from different states of the application or even different locations of the application. In my case, I needed an overloaded constructor to a PHP class. Yes, constructors are also a bit different in PHP 5 but still workable.</p>
<p><img class="alignnone size-full wp-image-239" title="overload_cargo" src="http://www.activoinc.com/blog/wp-content/uploads/2009/06/overload_cargo.jpg" alt="overload_cargo" width="700" height="406" /></p>
<p>To make a long story short, in PHP 5 there is no real way to overload a method like you can with Java. However, it seems like the developers of PHP 5 did have overloading methods in mind and allowed some form of it. It seems like allowing a real method overloads in PHP would be a special case of what the core developers actually allowed to do. The reason behind the current syntax is beyound me. I even tried to look for a PHP roadmap and see if proper method overloading will be introduced in the future but I could not find anything relevant.</p>
<p>A user with the name Noel has posted on DZone a little <a href="http://snippets.dzone.com/posts/show/3237">snippet of code that shows exactly how method overloading in PHP5</a> can be achieved.</p>
<p>Do you know of any intentions on including real method overloading in PHP6?</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>August 25, 2008 -- <a href="http://www.activoinc.com/blog/2008/08/25/zencart-ver-1-4-looking-ahead/" title="Looking Ahead: ZenCart ver 1.4">Looking Ahead: ZenCart ver 1.4</a> (3)</li><li>October 15, 2009 -- <a href="http://www.activoinc.com/blog/2009/10/15/zencart-1-3-8-and-php-5-2-11-bug-problem-login-to-admin-area/" title="ZenCart 1.3.8 and PHP 5.2.11 Bug: problem login to admin area">ZenCart 1.3.8 and PHP 5.2.11 Bug: problem login to admin area</a> (3)</li><li>August 1, 2009 -- <a href="http://www.activoinc.com/blog/2009/08/01/php-simplexml-rules/" title="PHP SimpleXML Rules!">PHP SimpleXML Rules!</a> (0)</li><li>February 16, 2009 -- <a href="http://www.activoinc.com/blog/2009/02/16/zend-studio-61-wrong-way-to-enhance-a-php-ide/" title="Zend Studio 6.1: Wrong Way to Enhance a PHP IDE!">Zend Studio 6.1: Wrong Way to Enhance a PHP IDE!</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.activoinc.com/blog/2009/06/25/method-overloading-workaround-in-php5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
