<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Backward Compatibility? We&#8217;ve heard of it.</title>
	<atom:link href="http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<lastBuildDate>Sun, 08 Nov 2009 19:29:21 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel Khan</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-10082</link>
		<dc:creator>Daniel Khan</dc:creator>
		<pubDate>Thu, 20 Oct 2005 23:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-10082</guid>
		<description>I&#039;m sometimes wondering if some people arguing here are doing real work for real clients in a real world or just some cool little thingies for their scool classes or college courses.

My story: 
Doing php since 1999 - running an IT company with several devs. Having about 200 sites (projects) out there. Having a web server farm with own projects as well as classical hosted sites not done by us on it.

I was able to switch from php 3 to php 4 and 5.

Now switching to 5.0.5 (A MINOR VERSION JUMP!!!) isn&#039;t possible to me. It&#039;s like committing suicide. 

O.K. I can hear you saying: &quot;I don&#039;t understand why you use current() on a method - that&#039;s ugly.&quot; Well - nobody told me the last ~6 years!
I didn&#039;t follow the internals list that much and I really didn&#039;t look under php&#039;s hood to see how this case is handled internally. 
It seems that I started this ugly thing somewhere between 2003 and 2004 - well. I really thought that a thing that works without notice (all projects have E_ALL switched on) will work in the future (at least within a major version).

I can understand what Greg pointed out (as always). 
But I&#039;m really fed up when I read this theoretical &quot;why did you ever do this ugly thing&quot; blabla.

I will certainly not roll up 6 years of work to find every single case which leads to this problem. Why? Because I have to pay my monthly bills. Nobody will pay me for that AND - doing a  current(Method) isn&#039;t a BUG in my code which I HAVE to fix for my customers for free.  Saying this is really ridiculous.

I think that we really need some kind of solution here.
And we need some kind of dialogue. The &quot;this isn&#039;t a bug - this is bogus - look into the changelog&quot; thing isn&#039;t the way to go.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sometimes wondering if some people arguing here are doing real work for real clients in a real world or just some cool little thingies for their scool classes or college courses.</p>
<p>My story:<br />
Doing php since 1999 &#8211; running an IT company with several devs. Having about 200 sites (projects) out there. Having a web server farm with own projects as well as classical hosted sites not done by us on it.</p>
<p>I was able to switch from php 3 to php 4 and 5.</p>
<p>Now switching to 5.0.5 (A MINOR VERSION JUMP!!!) isn&#8217;t possible to me. It&#8217;s like committing suicide. </p>
<p>O.K. I can hear you saying: &#8220;I don&#8217;t understand why you use current() on a method &#8211; that&#8217;s ugly.&#8221; Well &#8211; nobody told me the last ~6 years!<br />
I didn&#8217;t follow the internals list that much and I really didn&#8217;t look under php&#8217;s hood to see how this case is handled internally.<br />
It seems that I started this ugly thing somewhere between 2003 and 2004 &#8211; well. I really thought that a thing that works without notice (all projects have E_ALL switched on) will work in the future (at least within a major version).</p>
<p>I can understand what Greg pointed out (as always).<br />
But I&#8217;m really fed up when I read this theoretical &#8220;why did you ever do this ugly thing&#8221; blabla.</p>
<p>I will certainly not roll up 6 years of work to find every single case which leads to this problem. Why? Because I have to pay my monthly bills. Nobody will pay me for that AND &#8211; doing a  current(Method) isn&#8217;t a BUG in my code which I HAVE to fix for my customers for free.  Saying this is really ridiculous.</p>
<p>I think that we really need some kind of solution here.<br />
And we need some kind of dialogue. The &#8220;this isn&#8217;t a bug &#8211; this is bogus &#8211; look into the changelog&#8221; thing isn&#8217;t the way to go.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: mpigulla</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-9825</link>
		<dc:creator>mpigulla</dc:creator>
		<pubDate>Tue, 11 Oct 2005 09:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-9825</guid>
		<description>Rod says:
&lt;blockquote&gt;
return new Object();
is still perfectly valid. [...] Nico was wrong to suggest that
return new Foobar();
was invalid.
&lt;/blockquote&gt;

That&#039;s incorrect. Since 4.4.0, 

function &amp;byRef() { return new Foo(); }

triggers one of the new kind of &quot;Only variables can be returned...&quot; notices - unless inside Foo()&#039;s constructor $this is assigned by reference to something else. This is bogus, and the workaround &quot;return $tmp =&amp; new Foo()&quot; is ridiculous. (bugs.php.net/33679)</description>
		<content:encoded><![CDATA[<p>Rod says:</p>
<blockquote><p>
return new Object();<br />
is still perfectly valid. [...] Nico was wrong to suggest that<br />
return new Foobar();<br />
was invalid.
</p></blockquote>
<p>That&#8217;s incorrect. Since 4.4.0, </p>
<p>function &amp;byRef() { return new Foo(); }</p>
<p>triggers one of the new kind of &#8220;Only variables can be returned&#8230;&#8221; notices &#8211; unless inside Foo()&#8217;s constructor $this is assigned by reference to something else. This is bogus, and the workaround &#8220;return $tmp =&amp; new Foo()&#8221; is ridiculous. (bugs.php.net/33679)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: DanThies</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-8953</link>
		<dc:creator>DanThies</dc:creator>
		<pubDate>Mon, 26 Sep 2005 18:36:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-8953</guid>
		<description>Is this whole mess all about badly written code no longer working? Hasn&#039;t that happened before with new PHP releases?</description>
		<content:encoded><![CDATA[<p>Is this whole mess all about badly written code no longer working? Hasn&#8217;t that happened before with new PHP releases?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Lux</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-8915</link>
		<dc:creator>Lux</dc:creator>
		<pubDate>Fri, 23 Sep 2005 20:48:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-8915</guid>
		<description>Hi Rod,

Thanks for the clarification, that&#039;s very encouraging to know.  I&#039;ve also run 4.4 without trouble myself with our software, so this one appears to not be an issue.  We did have some BC issues with one of the 4.3.x series updates though, although we were able to resolve it fairly easily.

Cheers,

Lux</description>
		<content:encoded><![CDATA[<p>Hi Rod,</p>
<p>Thanks for the clarification, that&#8217;s very encouraging to know.  I&#8217;ve also run 4.4 without trouble myself with our software, so this one appears to not be an issue.  We did have some BC issues with one of the 4.3.x series updates though, although we were able to resolve it fairly easily.</p>
<p>Cheers,</p>
<p>Lux</p>]]></content:encoded>
	</item>
	<item>
		<title>By: rod</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-8906</link>
		<dc:creator>rod</dc:creator>
		<pubDate>Fri, 23 Sep 2005 01:10:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-8906</guid>
		<description>No, Lux.

return new Object();

is still perfectly valid.  The problem is:

return substr($foo,0,4);

You can return objects by reference.  ONLY objects.

Nico was wrong to suggest that

return new Foobar();

was invalid.

I bought into the FUD about backward compatibility.  Guess what?  When I finally upgraded, not a single line of my code had a problem.  And of all the third party apps, only squirrelmail had any problems and that was 1 line in each of 4 files.</description>
		<content:encoded><![CDATA[<p>No, Lux.</p>
<p>return new Object();</p>
<p>is still perfectly valid.  The problem is:</p>
<p>return substr($foo,0,4);</p>
<p>You can return objects by reference.  ONLY objects.</p>
<p>Nico was wrong to suggest that</p>
<p>return new Foobar();</p>
<p>was invalid.</p>
<p>I bought into the FUD about backward compatibility.  Guess what?  When I finally upgraded, not a single line of my code had a problem.  And of all the third party apps, only squirrelmail had any problems and that was 1 line in each of 4 files.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: dagfinn</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-8880</link>
		<dc:creator>dagfinn</dc:creator>
		<pubDate>Wed, 21 Sep 2005 10:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-8880</guid>
		<description>Here&#039;s a suggestion. I don&#039;t know if it&#039;s a good one, but try it on:

How about having a process and a forum dedicated to the public review of major changes to PHP? &quot;Major changes&quot; would be new features, BC breaks, anything which would be of interest to more than a small minority of users.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a suggestion. I don&#8217;t know if it&#8217;s a good one, but try it on:</p>
<p>How about having a process and a forum dedicated to the public review of major changes to PHP? &#8220;Major changes&#8221; would be new features, BC breaks, anything which would be of interest to more than a small minority of users.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Lux</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-8832</link>
		<dc:creator>Lux</dc:creator>
		<pubDate>Mon, 19 Sep 2005 01:06:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-8832</guid>
		<description>If the issue is with the code &quot;return new SomeClass()&quot; not working, then yes this is a bug in PHP that needs to be fixed.  That code was previously considered 100% valid, and should continue to be 100% valid.

http://bugs.php.net/bug.php?id=1991

That bug report is from 1999 acknowledging that they consider the above PHP statement to be valid back then.  If so, then why is it suddenly sloppy coding, as some people on here are saying?  I&#039;ve been coding in PHP since about that time, and I expect code I wrote then for the 4.x series to continue to work now.

Grepping my project tree, I found 157 instances of the string &quot;return new&quot; both in my own code as well as in 3rd party packages we use.  Perhaps that&#039;s what caused on outcry of new users having strange problems recently that never happened before.  BC is not just another nice-to-have, but the absolute most important thing to have.  Several recent BC breaks in the PHP 4.3.x series have caused needless trouble for our customers, and I fear this may just be the cause of yet one more.

The people who say BC breaks need to stop are right.  The only question that should be under discussion here is &quot;how?&quot;  BC breaks should only ever be acceptable between *major* releases and with proper notice to developers.  I have trouble enough with insidious BC breaks like the copy -&gt; clone change from 4.x to 5.x, which means serious code review before we can declare PHP5 support, which is work which has zero value for us or our customers -- ie. it&#039;s a waste of time.

So I made a decision that our company won&#039;t support PHP5 until we absolutely have to.  Even compatibility mode -- which can&#039;t be turned on on a per-application basis, making it roughly useless for most of our would-be PHP5 users -- isn&#039;t 100% BC.  This is a real issue with PHP, and it&#039;s not flaming to say so.  I&#039;m glad somebody had the balls to say it.  Cheers to them.</description>
		<content:encoded><![CDATA[<p>If the issue is with the code &#8220;return new SomeClass()&#8221; not working, then yes this is a bug in PHP that needs to be fixed.  That code was previously considered 100% valid, and should continue to be 100% valid.</p>
<p><a href="http://bugs.php.net/bug.php?id=1991" rel="nofollow">http://bugs.php.net/bug.php?id=1991</a></p>
<p>That bug report is from 1999 acknowledging that they consider the above PHP statement to be valid back then.  If so, then why is it suddenly sloppy coding, as some people on here are saying?  I&#8217;ve been coding in PHP since about that time, and I expect code I wrote then for the 4.x series to continue to work now.</p>
<p>Grepping my project tree, I found 157 instances of the string &#8220;return new&#8221; both in my own code as well as in 3rd party packages we use.  Perhaps that&#8217;s what caused on outcry of new users having strange problems recently that never happened before.  BC is not just another nice-to-have, but the absolute most important thing to have.  Several recent BC breaks in the PHP 4.3.x series have caused needless trouble for our customers, and I fear this may just be the cause of yet one more.</p>
<p>The people who say BC breaks need to stop are right.  The only question that should be under discussion here is &#8220;how?&#8221;  BC breaks should only ever be acceptable between *major* releases and with proper notice to developers.  I have trouble enough with insidious BC breaks like the copy -&gt; clone change from 4.x to 5.x, which means serious code review before we can declare PHP5 support, which is work which has zero value for us or our customers &#8212; ie. it&#8217;s a waste of time.</p>
<p>So I made a decision that our company won&#8217;t support PHP5 until we absolutely have to.  Even compatibility mode &#8212; which can&#8217;t be turned on on a per-application basis, making it roughly useless for most of our would-be PHP5 users &#8212; isn&#8217;t 100% BC.  This is a real issue with PHP, and it&#8217;s not flaming to say so.  I&#8217;m glad somebody had the balls to say it.  Cheers to them.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-8830</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Mon, 19 Sep 2005 00:23:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-8830</guid>
		<description>I found this on the internal mailing list and am copying it her for reference purposes.

Written by Rasmus Lerdorf (14 Sep 02:25 comp.php.devel):

We have been looking to see if there is a way to fix the memory
corruption issue in a way that has less of an impact on existing code.
This doesn&#039;t change the fact that every error you get is actually an
error in the code you are running.  The broken code is effectively doing
something similar to:

  function foo(&amp;$arg) {
    $arg = 4;
  }
  foo(strlen(&quot;abc&quot;));

which makes very little sense.  There are many variations of this, but
in every instance it is something that should be fixed, and in some of
the cases it actually leads to memory corruption.

There are many examples of this sort of thing working just fine in PHP
4.3.x because people are passing things in by reference and never
modifying the passed in value.  They&#039;ll do something along the lines of:

  function foo(&amp;$arg) {
     return $arg[0] + 1;
  }
  echo foo(array(1,2,3,4,5,6,7,8,9,10));

possibly because they believe that they are saving memory by not making
a copy of the array with that reference.  Of course that is quite
misguided as no copy is done until the arg is modified so if you don&#039;t
modify it, you are better off passing it by value.

Right now the change in 4.4 and 5.x is to complain loudly when you pass
a reference to something without any associated storage.  In both of the
above examples there is no permanent storage associated with either of
the passed arguments, so trying to get a reference to this storage makes
very little sense.  The only feasible way we might be able to work
around this is to make a copy of such bogus reference attempts and
effectively just pretend they were passed by value.  I think it is a bit
of a hack, but at the same time the breakage of existing apps has been
more widespread than I think anybody anticipated.  I&#039;d still want to
throw a notice to let people know they are doing something odd though.

-Rasmus</description>
		<content:encoded><![CDATA[<p>I found this on the internal mailing list and am copying it her for reference purposes.</p>
<p>Written by Rasmus Lerdorf (14 Sep 02:25 comp.php.devel):</p>
<p>We have been looking to see if there is a way to fix the memory<br />
corruption issue in a way that has less of an impact on existing code.<br />
This doesn&#8217;t change the fact that every error you get is actually an<br />
error in the code you are running.  The broken code is effectively doing<br />
something similar to:</p>
<p>  function foo(&amp;$arg) {<br />
    $arg = 4;<br />
  }<br />
  foo(strlen(&#8221;abc&#8221;));</p>
<p>which makes very little sense.  There are many variations of this, but<br />
in every instance it is something that should be fixed, and in some of<br />
the cases it actually leads to memory corruption.</p>
<p>There are many examples of this sort of thing working just fine in PHP<br />
4.3.x because people are passing things in by reference and never<br />
modifying the passed in value.  They&#8217;ll do something along the lines of:</p>
<p>  function foo(&amp;$arg) {<br />
     return $arg[0] + 1;<br />
  }<br />
  echo foo(array(1,2,3,4,5,6,7,8,9,10));</p>
<p>possibly because they believe that they are saving memory by not making<br />
a copy of the array with that reference.  Of course that is quite<br />
misguided as no copy is done until the arg is modified so if you don&#8217;t<br />
modify it, you are better off passing it by value.</p>
<p>Right now the change in 4.4 and 5.x is to complain loudly when you pass<br />
a reference to something without any associated storage.  In both of the<br />
above examples there is no permanent storage associated with either of<br />
the passed arguments, so trying to get a reference to this storage makes<br />
very little sense.  The only feasible way we might be able to work<br />
around this is to make a copy of such bogus reference attempts and<br />
effectively just pretend they were passed by value.  I think it is a bit<br />
of a hack, but at the same time the breakage of existing apps has been<br />
more widespread than I think anybody anticipated.  I&#8217;d still want to<br />
throw a notice to let people know they are doing something odd though.</p>
<p>-Rasmus</p>]]></content:encoded>
	</item>
	<item>
		<title>By: malikyte</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-8828</link>
		<dc:creator>malikyte</dc:creator>
		<pubDate>Sun, 18 Sep 2005 22:23:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-8828</guid>
		<description>@ccburns / Colin:
I&#039;d also like to point out that you complained that you don&#039;t feel you should have to come in to work because the IT staff decided to keep their software up to date...that&#039;s all well and good, except for the fact that there was no testing done first.  Who would roll out a completely new package on ANYTHING that is a business necessity without first testing something, especially if the old addage of &quot;if it ain&#039;t broke, don&#039;t fix it&quot; also applied in this instance?

Honestly, in this instance, I&#039;d say it was the decision on the person to upgrade the entire live system&#039;s fault.  Granted, I think we&#039;re talking theoretically, but even so.  This event *should* never happen, although I&#039;m sure it does.</description>
		<content:encoded><![CDATA[<p>@ccburns / Colin:<br />
I&#8217;d also like to point out that you complained that you don&#8217;t feel you should have to come in to work because the IT staff decided to keep their software up to date&#8230;that&#8217;s all well and good, except for the fact that there was no testing done first.  Who would roll out a completely new package on ANYTHING that is a business necessity without first testing something, especially if the old addage of &#8220;if it ain&#8217;t broke, don&#8217;t fix it&#8221; also applied in this instance?</p>
<p>Honestly, in this instance, I&#8217;d say it was the decision on the person to upgrade the entire live system&#8217;s fault.  Granted, I think we&#8217;re talking theoretically, but even so.  This event *should* never happen, although I&#8217;m sure it does.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Etnu</title>
		<link>http://www.sitepoint.com/blogs/2005/09/15/backward-compatibility-weve-heard-of-it/comment-page-1/#comment-8817</link>
		<dc:creator>Etnu</dc:creator>
		<pubDate>Sat, 17 Sep 2005 20:58:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1207#comment-8817</guid>
		<description>[quote]Web host and such don’t use PHP5 at all, so why would this matter?[/quote]

Most web hosts are running php5 now. In fact, up until this recent fatal error, PHP 4 code ran on the PHP5 installations without issue.

I fully expect that very few people will upgrade to 5.0.5 from 5.0.4, but will upgrade instead directly to 5.1 when it ships and a better solution is in place for the problem (along with all the php4-only stragglers).

[quote]I would like to know what *exactly* is going to break my code.
Is there a place that discusses in more details what will and what won’t break (with examples)?[/quote]

The ONLY thing that will break will be in cases where you&#039;re attempting to return something that IS NOT A VARIABLE by reference. Check the php-internals mailing list (it&#039;s on the php.net site) for more details.</description>
		<content:encoded><![CDATA[<p>[quote]Web host and such don’t use PHP5 at all, so why would this matter?[/quote]</p>
<p>Most web hosts are running php5 now. In fact, up until this recent fatal error, PHP 4 code ran on the PHP5 installations without issue.</p>
<p>I fully expect that very few people will upgrade to 5.0.5 from 5.0.4, but will upgrade instead directly to 5.1 when it ships and a better solution is in place for the problem (along with all the php4-only stragglers).</p>
<p>[quote]I would like to know what *exactly* is going to break my code.<br />
Is there a place that discusses in more details what will and what won’t break (with examples)?[/quote]</p>
<p>The ONLY thing that will break will be in cases where you&#8217;re attempting to return something that IS NOT A VARIABLE by reference. Check the php-internals mailing list (it&#8217;s on the php.net site) for more details.</p>]]></content:encoded>
	</item>
</channel>
</rss>
