PHPNews

PHP 7 Virtual Machine

This article aims to provide an overview of the Zend Virtual Machine, as it is found in PHP 7. This is not a comprehensive description, but I try to cover most of the important parts, as well as some of the finer details. This description targets PHP version 7.2 (currently in development), but nearly everything …

Continue reading »

Written by Nikita Popov - - Aggregated on Friday April 14, 2017


Internal value representation in PHP 7 - Part 2

In the first part of this article, high level changes in the internal value representation between PHP 5 and PHP 7 were discussed. As a reminder, the main difference was that zvals are no longer individually allocated and don’t store a reference count themselves. Simple values like integers or floats can be stored …

Continue reading »

Written by Nikita Popov - - Aggregated on Friday June 19, 2015


Internal value representation in PHP 7 - Part 1

My last article described the improvements to the hashtable implementation that were introduced in PHP 7. This followup will take a look at the new representation of PHP values in general. Due to the amount of material to cover, the article is split in two parts: This part will describe how the zval (Zend value) …

Continue reading »

Written by Nikita Popov - - Aggregated on Tuesday May 5, 2015


PHP's new hashtable implementation

About three years ago I wrote an article analyzing the memory usage of arrays in PHP 5. As part of the work on the upcoming PHP 7, large parts of the Zend Engine have been rewritten with a focus on smaller data structures requiring fewer allocations. In this article I will provide an overview of the new hashtable …

Continue reading »

Written by Nikita Popov - - Aggregated on Monday December 22, 2014


Methods on primitive types in PHP

A few days ago Anthony Ferrara wrote down some thoughts on the future of PHP . I concur with most of his opinions, but not all of them. In this post I’ll focus on one particular aspect: Turning primitive types like strings or arrays into “pseudo-objects” by allowing to perform method calls on them. Lets start off …

Continue reading »

Written by Nikita Popov - - Aggregated on Friday March 14, 2014


Fast request routing using regular expressions

Some time ago I stumbled on the Pux routing library, which claims to implement a request router that is many orders of magnitude faster than the existing solutions. In order to accomplish this, the library makes use of a PHP extension written in C. However, after a cursory look at the code I had the strong …

Continue reading »

Written by Nikita Popov - - Aggregated on Tuesday February 18, 2014


The case against the ifsetor function

Recently igorw wrote a blog post on how to traverse nested array structures with potentially non-existing keys without throwing notices. The current “idiomatic” way to do something like this, is to use isset() together with a ternary operator: $age = (isset($data['people'][0]['age'])) ? $data['people'][0][…

Continue reading »

Written by Nikita Popov - - Aggregated on Friday January 10, 2014


Are PHP developers functophobic?

There is this one thing that I noticed recently and that concerns me: PHP devs don’t use functions. Now, that was overly general, so let me clarify: PHP developers who have reached a certain degree of sophistication basically stop using plain functions - instead everything goes all classes and methods. At least …

Continue reading »

Written by Nikita Popov - - Aggregated on Friday August 10, 2012