News Feed
Sections




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

Sherif Ramadan:
A Closer Look Into PHP Arrays What You Don't See
October 29, 2012 @ 11:43:33

In a new post Sherif Ramadan takes an in-depth look at PHP arrays and what happens behind the scenes when they're put to use.

PHP is one unique language where the array data type has been highly generalized to suit a very broad set of use cases. [...] I'm going to share with you some of the underlying details of how the PHP array data type works, why it works the way that it does, how it's different from other languages, and what behaviors the PHP array has that you may not be fully aware of.

He starts with a section looking at what arrays actually are in PHP (and how they compare to the lower level C arrays). He gives a C-based array example and shows how it's stored in memory. He points out how PHP arrays are different from other languages and shows the C code that works behind the scenes to create the array (actually a hashtable). He gets into a detailed explanation of the iteration of arrays including some basic benchmarks of some of the various methods and gets more in-depth with foreach (including subarrays and arrays containing references).

0 comments voice your opinion now!
array language c hashtable indepth variable


blog comments powered by Disqus

Similar Posts

Community News: Do You Know PHP? (Quiz)

Bryan's Blog: 5 (More) Ways to be a Better PHP Developer

PHP-Coding-Practices.com: How I Turned A Slow Array Sort Into A Quick One Using Quicksort Algorithm

LivePipe Blog: What PHP6 Actually Needs

Matthew Weir O'Phinney's Blog: Overloading arrays in PHP 5.2.0


Community Events

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


configure podcast framework introduction symfony2 php7 language application interview part2 performance conference release example api opinion series laravel community install

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