PHP

Setting up XDebug for PHPStorm on Windows & WSL2

In this post, I’m going to go over my short journey to setup my PHP development environment on Windows 10. I will tell you how to setup PHPStorm to debug PHP applications using XDebug and PHP setup over Ubuntu 18.04 LTS on WSL2. I would like to work against the latest version of PHP and compile it myself. At the same time, setting up extensions and compiling PHP itself on windows is not a very straightforward task as far as I know. The plan is to have the development environment run from Linux (WSL2) while the IDE, which is PHPStorm...

Continue reading...

Getting started with PHP-CFG

PHP-CFG is PHP project developed by Anthony Ferrara. It uses PHP-Parser to generate the AST from the PHP code. Then transforms this into another intermediate representation in the form of a control flow graph. This enables us an easy way to traverse this graph and reason about the execution of the underlying PHP code. Getting started To get started, you’d need to know some basic compiler concepts. The audience of this post are people from a variety of backgrounds so I’ll try to cover as much as possible. If some concepts don’t make sense through out the text, it is...

Continue reading...

PHP builtin functions usage statistics

I was working on a project which required implementation of PHP builtin functions. To understand the scope of the project and its implementation effort I thought it is a good idea to get an estimate of the total number of these functions, and also, how frequently they are used among popular PHP applications. This would give me a rough idea of how many functions I need to implement myself. At the same time, the results can be leveraged to get insight into debloating effectiveness for these applications. Which is something that I’ve been working on for over a year now....

Continue reading...