23

PhpInternals

 6 years ago
source link: https://phpinternals.net
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

PHP InternalsArticles Documentation Categories

Welcome!

This website is dedicated to providing resources on PHP's internals. All content covers PHP 7+, with the documentation typically targeting the current master branch of php-src.

Latest Articles

Optimising Internal Functions via New Opcode Instructions

Author: Thomas Punt

Date: 22 Nov 2017

In this article, we will take a look at the optimisation technique of converting built-in functions to opcodes. This will involve firstly taking a look at how it has been used upon a number of functions in the latest PHP 7.2 release for greater performance. We will then go on to write our own implementation to optimise the ord function for a more in-depth look at the application of this optimisation technique.

Implementing New Language Constructs via Opcode Extending

Author: Thomas Punt

Date: 11 Sep 2017

In this article, we will be implementing two new language constructs: echoln and println. These will be the counterparts of echo and print, where they will append a new line (\n) to their outputs. This will be done by extending the ZEND_ECHO opcode (used by echo and print) to prevent unnecessary code duplication.

A Reimplementation of the Range Operator

Author: Thomas Punt

Date: 6 Mar 2017

In this follow-up article to Implementing a Range Operator in PHP, we redo part of the previous implementation to remove several of the limitations it had. I will show how these limitations (around the handling of the operator in constant expression contexts) can be removed by shifting the operator's logic out of the VM and into the compiler to support compile-time evaluations - a necessity to enable for the operator to be used in constant expression contexts.

Implementing a Range Operator into PHP

Author: Thomas Punt

Date: 5 Mar 2017

This article will demonstrate how to implement a new operator in PHP. This will involve updating the lexer, parser, compiler, and VM to support this new syntax. This will provide a brief overview of a number of PHP's internal aspects, particularly the stages PHP's interpreter goes through when executing PHP code.

Implementing a Digit Separator

Author: Thomas Punt

Date: 4 Mar 2017

The digit separator provides developers with a way to format numerical literals in code. This provides greater readability to large numbers by breaking them into sub-groups, where a character (the underscore, in this case) acts as a delineator.

This article will explain how we can add this relatively simple feature into PHP.

How to Contribute

To contribute to the documentation, simply sign in with your GitHub account and then navigate to the Contribute page for the appropriate links.

To begin with, all of your contributions will need reviewing by a more privileged member. Once you have made some contributions, a request for a more privileged account can be made (either by pinging @tpunt in room 11, or emailing [email protected]). Privileged accounts do not require their patches to be reviewed, and they are able to review the patches of other members.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK