News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Derick Rethans' Blog:
Collecting Garbage PHP's take on variables
August 31, 2010 @ 10:49:11

Derick Rethans is republishing an article series he wrote (originally for php|architect) about the garbage collection that is included with the PHP 5.3 releases. He kicks off the series with this first post introducing internal variable handling.

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.

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 xdebug_debug_zval 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, Derick points to this article for more detail.

0 comments voice your opinion now!
garbage collection variable introduction zval reference xdebug


blog comments powered by Disqus

Similar Posts

Xml.it Blog: Open-source PHP profiler

Gary Hokin: An Introduction to Zend Framework 2 for the Zend Framework 1 Developer - Part 1

PHP-Coding-Practices.com: Composing Methods: Split Temporary Variable

PHPBuilder.com: Tracking User Activity in PHP with Cookies and Sessions

PHPMaster.com: Bending XML to Your Will


Community Events





Don't see your event here?
Let us know!


list library laravel symfony artisanfiles opinion voicesoftheelephpant podcast security series release community version language conference introduction interview composer tool framework

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework