<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Operator overloading in PHP</title>
	<atom:link href="http://www.techfounder.net/2008/07/08/operator-overloading-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techfounder.net/2008/07/08/operator-overloading-in-php/</link>
	<description>Blog about web development and Internet entrepreneurship</description>
	<pubDate>Fri, 21 Nov 2008 16:02:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Eran Galperin</title>
		<link>http://www.techfounder.net/2008/07/08/operator-overloading-in-php/#comment-85</link>
		<dc:creator>Eran Galperin</dc:creator>
		<pubDate>Sat, 12 Jul 2008 18:53:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=71#comment-85</guid>
		<description>Actually there is some to be said for using a period to concatenate strings since it allows the plus operator to perform mathematical calculations on variables without worrying about their type. This distinction always annoyed me in Javascript since it forces you to constantly cast numerical strings into numbers so you could perform calculations with them. HTML inputs will always return a string value, so having this happen automatically in PHP is useful on the web.

But I was actually referring more to array operator casting. Being able to perform array merging on two objects using the plus sign, and having their __toArray() overloading method kick in and return the a merged array would be very useful in a lot of applications.</description>
		<content:encoded><![CDATA[<p>Actually there is some to be said for using a period to concatenate strings since it allows the plus operator to perform mathematical calculations on variables without worrying about their type. This distinction always annoyed me in Javascript since it forces you to constantly cast numerical strings into numbers so you could perform calculations with them. HTML inputs will always return a string value, so having this happen automatically in PHP is useful on the web.</p>
<p>But I was actually referring more to array operator casting. Being able to perform array merging on two objects using the plus sign, and having their __toArray() overloading method kick in and return the a merged array would be very useful in a lot of applications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Turland</title>
		<link>http://www.techfounder.net/2008/07/08/operator-overloading-in-php/#comment-84</link>
		<dc:creator>Matthew Turland</dc:creator>
		<pubDate>Sat, 12 Jul 2008 18:09:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=71#comment-84</guid>
		<description>I've always wondered why a period was used for string concatenation in PHP instead of a plus sign as other dynamically typed languages like Python and JavaScript do, especially since the plus sign is used for array unions. 

The only other case I know of for operator overloading offhand is matrices as they are used in linear algebra, but that could just as easily be accomplished using methods. 

In short, operator overloading would only provide syntactic sugar where methods to accomplish the same purposes already exist. The same can be said for issues that seem to continue resurfacing such as named parameters or shorthand array notation.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve always wondered why a period was used for string concatenation in PHP instead of a plus sign as other dynamically typed languages like Python and JavaScript do, especially since the plus sign is used for array unions. </p>
<p>The only other case I know of for operator overloading offhand is matrices as they are used in linear algebra, but that could just as easily be accomplished using methods. </p>
<p>In short, operator overloading would only provide syntactic sugar where methods to accomplish the same purposes already exist. The same can be said for issues that seem to continue resurfacing such as named parameters or shorthand array notation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eran Galperin</title>
		<link>http://www.techfounder.net/2008/07/08/operator-overloading-in-php/#comment-68</link>
		<dc:creator>Eran Galperin</dc:creator>
		<pubDate>Tue, 08 Jul 2008 23:03:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=71#comment-68</guid>
		<description>If it's used correctly or not, that's up to the developer. The same could be said of many other language features ;)

I think some additional operator overloading features would allow us to create more natural API's and to have convenience options which never hurts. I personally don't see it as a priority, but if it could be implemented it would be a 'nice-to-have'.</description>
		<content:encoded><![CDATA[<p>If it&#8217;s used correctly or not, that&#8217;s up to the developer. The same could be said of many other language features <img src='http://www.techfounder.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I think some additional operator overloading features would allow us to create more natural API&#8217;s and to have convenience options which never hurts. I personally don&#8217;t see it as a priority, but if it could be implemented it would be a &#8216;nice-to-have&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Strojny</title>
		<link>http://www.techfounder.net/2008/07/08/operator-overloading-in-php/#comment-67</link>
		<dc:creator>Lars Strojny</dc:creator>
		<pubDate>Tue, 08 Jul 2008 22:24:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=71#comment-67</guid>
		<description>The issue with operator overloading is, that it is rarely used correctly. The only relevant usage examples are so called value objects. The classical "Money" object, e.g. So I think the benefit is relatively minimal and the potential for abuse is huge. Nevertheless, I would not mind a proper RFC and a patch.</description>
		<content:encoded><![CDATA[<p>The issue with operator overloading is, that it is rarely used correctly. The only relevant usage examples are so called value objects. The classical &#8220;Money&#8221; object, e.g. So I think the benefit is relatively minimal and the potential for abuse is huge. Nevertheless, I would not mind a proper RFC and a patch.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
