<?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>Sat, 25 May 2013 00:05:17 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Anthony Ferrara's Blog: PHP's Source Code For PHP Developers - Part 3 - Variables]]></title>
      <guid>http://www.phpdeveloper.org/news/17711</guid>
      <link>http://www.phpdeveloper.org/news/17711</link>
      <description><![CDATA[<p>
The third part of the "PHP source for developers" series has been posted over on <i>Anthony Ferrara</i>'s blog today looking at <a href="http://blog.ircmaxell.com/2012/03/phps-source-code-for-php-developers_21.html">the variables PHP's internals use</a>.
</p>
<blockquote>
In this third post of the PHP's Source Code for PHP Developers series, we're going to expand on the prior posts to help understand how PHP works internally.  In the first post of the  series, we looked at how to view PHP's source code, how it's structured as well as some basic C pointers for PHP developers.  The second post introduced functions into the mix.  This time around, we're going to dive into one of the most useful structures in PHP: variables.
</blockquote>
<p>
He starts with one of the most important variable types used in PHP's source - the ZVAL. This is one of the keys to PHP's loose typing and can be thought of as "a class with only public properties". He gets into more detail with the properties of this "class" (value, refcount__gc, type and is_ref__gc). Also included is a look at how it's actually used - creating new ones, getting the value of them, converting their types and how the internal PHP functions parse their variables.
</p>
<p>
There's a lot more covered about variables in <a href="http://blog.ircmaxell.com/2012/03/phps-source-code-for-php-developers_21.html">the post</a> so if this is interesting stuff to you, be sure to read it all. They've done a great job of explaining one of the more complicated parts of the internals that power PHP.
</p>]]></description>
      <pubDate>Thu, 22 Mar 2012 08:30:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Collecting Garbage: PHP's take on variables]]></title>
      <guid>http://www.phpdeveloper.org/news/15049</guid>
      <link>http://www.phpdeveloper.org/news/15049</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> is republishing an article series he wrote (originally for <a href="http://phparch.com">php|architect</a>) about the garbage collection that is included with the PHP 5.3 releases. He kicks off the series with <a href="http://derickrethans.nl/collecting-garbage-phps-take-on-variables.html">this first post</a> introducing internal variable handling.
</p>
<blockquote>
Before we start with the intricate details of PHP's new GC engine I will explain why it is actually needed. This, combined with an introduction how PHP deals with variables in general is explained in this first part of the column. The second part will cover the solution and some notes on the GC mechanism itself, and the third part covers some implications of the GC mechanism, as well as some benchmarks. But now first on to the introduction.
</blockquote>
<p>
He introduces the concept of a "zval" - the container PHP uses internally to handle variables (along with its "is_ref" and "refcount" to tell the interpreter if it's a reference or not). He also shows how these relate to the variables you set in your applications as well as a mention of the <a href="http://www.xdebug.org/docs/all_functions#xdebug_debug_zval">xdebug_debug_zval</a> function of XDebug to show how it's handled behind the scenes. He also shows how references are handled with accompanying images to show the flow. If you'd like more information on variable handling, <i>Derick</i> points to <a href="http://derickrethans.nl/files/phparch-php-variables-article.pdf">this article</a> for more detail.
</p>]]></description>
      <pubDate>Tue, 31 Aug 2010 10:49:11 -0500</pubDate>
    </item>
  </channel>
</rss>
