Nikita Popov, PHP

Nikita Popov, PHP

Blog by nikic. Find me on GitHub, StackOverflow and Twitter. Learn more about me.
PHP 7 Virtual Machine 14. April 2017
An overview of the PHP virtual machine.
Internal value representation in PHP 7 – Part 2 19. June 2015
Covers the implementation of complex types like strings and objects in PHP 7, as well as a number of special types like indirect zvals.
Internal value representation in PHP 7 – Part 1 05. May 2015
Describes and compares the zval implementations used by PHP 5 and PHP 7, including a discussion of references. Other types are covered in the next part.
PHP’s new hashtable implementation 22. December 2014
In this article we’ll explore how the new hashtable implementation used by PHP 7 improved memory usage and performance.
Methods on primitive types in PHP 14. March 2014
This article discusses the merits of allowing method calls on primitive PHP types, like strings and arrays.
Fast request routing using regular expressions 18. February 2014
This article describes a number of techniques to improve performance of regular expression based dispatch processes, as used in request routing or lexing.
The case against the ifsetor function 10. January 2014
The ifsetor function can be used to suppress notices when accessing array indices. This post discusses some of the issues this function has and how to resolve them.
Cooperative multitasking using coroutines (in PHP!) 22. December 2012
This post explains how coroutines can be used for task scheduling and handling asynchronous operations in a synchronous-seeming way.
Are PHP developers functophobic? 10. August 2012
PHP developers don’t seem to like normal functions much. I think that this is related to the one-to-one class to file mapping that PHP has inherited from Java.
How to add new (syntactic) features to PHP 27. July 2012
In this post I’m describing how one can add new syntax to PHP. At the same time, this post can be seen as a general introduction to the workings of the Zend Engine.
What PHP 5.5 might look like 10. July 2012
PHP 5.5 is still in an early development stage, but there are already many proposals that are being worked on. This post gives some insights into the recent developments.
A plea for less (XML) configuration files 09. July 2012
Configuration files typically use XML or some other domain specific language. But why? Why not just use the usual programming language instead?
PHP solves problems. Oh, and you can program with it too! 29. June 2012
PHP is a great language to start programming. And once you started, PHP is also good for “real” programming. So what’s the problem?
The true power of regular expressions 15. June 2012
There is a major misunderstanding about what modern regular expression implementation can or cannot do. This article analyses the situation by walking through the different grammar classes.
Understanding PHP’s internal array implementation (PHP’s Source Code for PHP Developers – Part 4) 28. March 2012
The fourth part of the “PHP’s Source Code for PHP Developers” series, covering how arrays are internally implemented in PHP and how they are used in the source code.
PHP’s Source Code for PHP Developers – Part 3 – Variables 21. March 2012
Cross-link to the third part of the “PHP’s Source Code for PHP Developers” series, covering how PHP values are represented internally and used throughout the source code.
Understanding PHP’s internal function definitions (PHP’s Source Code for PHP Developers – Part 2) 16. March 2012
The second part of the “PHP’s Source Code for PHP Developers” series, covering how to find functions in the PHP source code and how they are structured.
Scalar type hinting is harder than you think 06. March 2012
A quick overview of the different scalar type hinting proposals and why PHP is having such a hard time deciding.
Pointer magic for efficient dynamic value representations 02. February 2012
JS implementations use some neat tricks to achieve good performance. One of those tricks is a good bit of pointer magic to make dynamically typed values more efficient.
htmlspecialchars() improvements in PHP 5.4 28. January 2012
There is some nice new stuff for htmlspecialchars() in PHP 5.4, which hasn’t yet got the attention it deserves.
Careful: XDebug can skew your performance numbers 19. January 2012
In some cases XDebug can significantly skew your benchmarking and profiling numbers. So make sure that you do measurements without it.
Disproving the Single Quotes Performance Myth 09. January 2012
One of the oldest myths around PHP is that single quotes are faster than double quotes. And. It. Is. Not. True.
Supercolliding a PHP array 28. December 2011
Inserting 65536 specially crafted values into a PHP array can take 30 seconds, whereas normally it would only take 0.01 seconds.
Don’t be STUPID: GRASP SOLID! 27. December 2011
Introducing STUPID: Singleton, Tight Coupling, Untestability, Premature Optimization, Indescriptive Naming, Duplication.
How big are PHP arrays (and values) really? (Hint: BIG!) 12. December 2011
PHP’s memory usage might seem atrocious to some – twenty times more than the optimum you would have in C. This post tries to explain those numbers and why they are necessary.
PCRE and newlines 10. December 2011
There is a huge number of newline related features in PCRE (regular expressions) that nearly nobody knows about. I want to shed light on some of those.
Manually installing PEAR on Windows 03. December 2011
If you ever tried to install PEAR on Windows you probably know what a woeful task it is. This is a short instruction on how to manually install PEAR (without using go-pear.phar).
PHP internals: When does foreach copy? 11. November 2011
PHP’s foreach language construct sometimes copies the array it iterates and sometimes does not. This post analyzes when and why this happens.
Improving lexing performance in PHP 23. October 2011
Some thoughts on improving lexing performance in PHP by compiling the individual token regexes into one big super-regex.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.