<?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>Professional PHP &#187; php-references</title>
	<atom:link href="http://www.procata.com/blog/archives/tag/php-references/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.procata.com/blog</link>
	<description>PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.</description>
	<lastBuildDate>Fri, 10 Dec 2010 17:23:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP 5.1 is out</title>
		<link>http://www.procata.com/blog/archives/2005/11/25/php-51-is-out/</link>
		<comments>http://www.procata.com/blog/archives/2005/11/25/php-51-is-out/#comments</comments>
		<pubDate>Fri, 25 Nov 2005 19:56:10 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[compatibility-testing]]></category>
		<category><![CDATA[php-namespaces]]></category>
		<category><![CDATA[php-references]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=160</guid>
		<description><![CDATA[PHP 5.1.0 is out.  There is alot of good stuff in this release and it is a major milestone.  May PHP 5.1.2 be as successful as PHP 4.1.2.
I say 5.1.2 because it looks like there are is going to be at least one, possibly two bug fix releases to follow.  There is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.php.net/">PHP 5.1.0</a> is out.  There is alot of good stuff in this release and it is a major milestone.  May PHP 5.1.2 be as successful as PHP 4.1.2.</p>
<p>I say 5.1.2 because it looks like there are is going to be at least one, possibly two bug fix releases to follow.  There is a bit of a kerfuffle about the introduction of a date class into PHP 5.1rc6, which conflicts with the current PEAR date class.  Unfortunately, the naming conflict is not (yet) documented in the <a href="http://www.php.net/README_UPGRADE_51.php">upgrade notes</a> which I praised in my <a href="http://www.procata.com/blog/archives/2005/11/22/a-glimpse-into-the-future-php-6/">PHP 6 post</a> just a couple of days ago.</p>
<p>Ok, so reserving common class names in the release candidate just before the release, during a major holiday week (in the US at least) is probably a mistake.  I don&#8217;t disagree with PHP reserving the Date class.  Honestly, anyone using that name should half expect it.  However, I don&#8217;t think anyone likes surprises, especially late in a release cycle.  But, people are not machines and sometimes mistakes are made.  (To use another cliche, sometimes sausage making is not pretty.)</p>
<p>After the <a href="http://www.procata.com/blog/archives/2005/10/20/of-php-references-and-compatibility/">Reference compatibility thing</a> I thought there was supposed to be a <a href="http://www.derickrethans.nl/php_release_process.php">process in place</a> to catch surprises like this.  What happened? </p>
<p>Some people are pointing to this naming conflict as evidence of the dire need for namespace support in PHP.  Fair enough.</p>
<p>So in this case the process for detecting backward compatibility breaks relied on a large group of people testing their applications through a rapid succession of release candidates.  Since I agree with the rapid succession of release candidates, I have to see the weak part of the process as relying on people to test stuff.  After all, people aren&#8217;t machines.</p>
<p>However, machines ARE machines and automated compatibility testing could have caught this.  I have a corpus of PHP code with automated tests that I could donate to a BC testing lab.  I&#8217;m sure other people do.  I can&#8217;t necessarily download a new release candidate and run it every other day, but I could package my code up and send it someplace to be run.  Where can I send it?</p>
<p>(Yeah, I know calling for BC testing lab without volunteering to run it is the open source equivalent of the <a href="http://en.wikipedia.org/wiki/Unfunded_mandates">unfunded mandate</a>.  But hey, its my blog and I&#8217;ll suggest, complain or critique if I want to.  <img src='http://www.procata.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>One last thing, don&#8217;t let a few minor issues overshadow the good hard work that went into this release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2005/11/25/php-51-is-out/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Of PHP References and Compatibility</title>
		<link>http://www.procata.com/blog/archives/2005/10/20/of-php-references-and-compatibility/</link>
		<comments>http://www.procata.com/blog/archives/2005/10/20/of-php-references-and-compatibility/#comments</comments>
		<pubDate>Fri, 21 Oct 2005 05:38:29 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[performance-optimization]]></category>
		<category><![CDATA[php-5]]></category>
		<category><![CDATA[php-references]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=149</guid>
		<description><![CDATA[Following up on the Backward compatibilty and web host adoption of PHP 5 post from two weeks ago, I got a pretty good education about the problem with taking a reference of $this.  The best summary is in this bug report.
It comes down to the fact that allowing references to be taken of $this [...]]]></description>
			<content:encoded><![CDATA[<p>Following up on the <a href="http://www.procata.com/blog/archives/2005/10/02/backward-compatibilty-and-web-host-adoption-of-php-5/">Backward compatibilty and web host adoption of PHP 5</a> post from two weeks ago, I got a pretty good education about the problem with taking a reference of $this.  The best summary is in <a href="http://bugs.php.net/bug.php?id=28491">this bug report</a>.</p>
<p>It comes down to the fact that allowing references to be taken of $this can lead to unexpected values for $this later on.  ($this re-assigned)  However, it does not appear that a good solution exists:</p>
<blockquote><p>
Given the choice between: (A) doing nothing but leaving room for confusion, (B) taking away the ability to create references, or (C) checking assignments for references to $this(read: slow);  The current decision is to go with (A).
</p></blockquote>
<p>The cause of the problems were a result of diverging away from strategy A and a little bit into strategy B.  I&#8217;m still working on <a href="http://bugs.php.net/bug.php?id=34844">compiling 5.1rc3</a>, so i&#8217;m not yet sure how this was actually resolved.  I wouldn&#8217;t feel bad about a warning when this occurred.  However, I think a fatal error is absolutely wrong here.  I do feel confident this will get resolved in an acceptable manner because  I&#8217;m fairly sure that unless it becomes illegal to pass $this to a function by reference that there will always be a workaround for making code compatible with PHP 4 regarding $this.  Thanks to everyone who looked in to it.</p>
<p>In the meantime, Derrick Rethans made an article he wrote for php|architect explaining <a href="http://www.derickrethans.nl/php_references_article.php">PHP References</a> available.  You should read this article.  I had to print it to follow it, but I learned something that I did not know.  I did not know that PHP uses a copy on write semantic for normal variables.  The one question that I wish the article had covered was how objects get automatically passed by reference in PHP 5.</p>
<p>The article debunks some myths about using references for performance.  I experimented with this a bit when PHP 4 first came out, but quickly gave up on using references for optimization.  I ended up with too many mysterious bugs to track down from &#8220;magically connected&#8221; variables.  I finally ended with some fairly limited rules for using references.  I avoid them in all cases except when passing values to functions by reference and for variables that held objects, in which case I use them always.  When I want mystery i&#8217;ll go to the library, thank you.  I don&#8217;t need it in my software.</p>
<p>I&#8217;ve been looking at the changes necessary for the php 4.4/5.0.5 update.  I wrote a little <a href="http://www.procata.com/software/scanrefret/scanrefret.phps">scanner program</a> to help locate suspicious return statements.  (I&#8217;m far from E_STRICT anyway.)  But, I have no programatic help for finding &#8220;Only variables can be passed by reference&#8221; errors except to actually trigger the error.</p>
<p>I&#8217;ve been a little bit frustrated about getting over the compatibility hump with 4.4/5.0.5/5.1rc3.  But that seems like nothing compared to the ingrate who emailed Derrick <a href="http://www.derickrethans.nl/fanmail.php">fan mail</a>.  This dude needs to get a grip.</p>
<p>I don&#8217;t think the update was a mistake at all.  Like I said earlier, I&#8217;ll take my PHP without mysterious bugs, please.  Rather, I think the mistake here was in not understanding the backward compatibility issues.  I went back and read some of the <a href="http://groups.google.com/group/mailing.www.php-dev/browse_frm/thread/d50625abfe3d0383/">orginal discussion</a> about this update.  What strikes me was that binary compatibility was discussed, but no-one seemed that excited about the backward compatibility issues at the code level.</p>
<p>So a mistake was made.  These things happen.  <a href="http://www.derickrethans.nl/php_release_process.php">Steps have been taken</a> to ensure that something like this is less likely happen again.  Derrick&#8217;s fan needs to get over it and move on.</p>
<p><a href="http://www.derickrethans.nl/php_release_process.php">Along these lines</a>, It seems like with so many projects using automated testing that there should be a process for projects with automated test suites to package them up and donate them to an automated backward compatibility lab.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2005/10/20/of-php-references-and-compatibility/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

