<?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, 24 May 2012 04:53:37 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Derick Rethans' Blog: PHP's two-pass compiler]]></title>
      <guid>http://www.phpdeveloper.org/news/11833</guid>
      <link>http://www.phpdeveloper.org/news/11833</link>
      <description><![CDATA[<p>
While working on an issue with debugging a script of his via XDebug, <i>Derick Rethans</i> was <a href="http://derickrethans.nl/phps_twopass_compiler.php">reminded of something</a> that is an integral part of the PHP language - its two phase compiler.
</p>
<blockquote>
During the first pass, it will find out to which opcode it needs to jump in the jump instructions. However, the PHP engine (and Xdebug) expects a memory address to jump to while executing your script. In the second pass, the compiler will then go over the generated opcodes and calculate the memory address to jump to from the jumps to opcode numbers. 
</blockquote>
<p>
Because of the way that XDebug was handling the checks (with the user-defined error handler) and how the opcodes inside of PHP are handled, the user-defined handler happened in between the first and second phases and the latter run couldn't find the resources it was looking for, thus the crash.
</p>]]></description>
      <pubDate>Wed, 28 Jan 2009 12:06:34 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Alan Knowles' Blog: Code Reviewing.]]></title>
      <guid>http://www.phpdeveloper.org/news/6091</guid>
      <link>http://www.phpdeveloper.org/news/6091</link>
      <description><![CDATA[<p>
In a <a href="http://www.akbkhome.com/blog.php/View/122/Code_Reviewing.html">great new post</a> from <i>Alan Knowles</i> he takes a look at code reviewing, specificaly in a PHP environment.
</p>
<p>
He breaks the post up into phases (one through four) with the steps outlined along the way (including the "oh sh*t, it's getting urgent, we better fix the delivered code and make it work well enough for the client to start testing" phase). Phase four is the largest, being the bug finding and fixing stage, some of the more intensive (and sometimes numbing) times of development.
</p>
<p>
He <a href="http://www.akbkhome.com/blog.php/View/122/Code_Reviewing.html">also includes</a> a good, long list of some of the codeing standards he's accumulated over time, including:
<ul>
<li>Not creating PHP includes with functions in them!
<li>Never hard code email subjects etc. in code, use templates.
<li>Not using libraries that where not specified.. or using non-PEAR libraries when PEAR ones are available...
<li>Everything extends the base class, even code run via cron jobs.
</ul>
</p>
<p>
He also talks about using print rather than echo, exiting on XMLHttpRequest calls, shortcuts in Javascript, and cloning dataobject arrays over creating simple structs.
</p>]]></description>
      <pubDate>Mon, 21 Aug 2006 07:56:39 -0500</pubDate>
    </item>
  </channel>
</rss>

