Member-only story
The Magic Behind PHP
Are you curious about how PHP works internally? This post is the first in a series about better understanding PHP and how it works. In the next posts, I will cover OPcache, preloading, and also JIT. But first, let’s start with non-optimized PHP.
Definition Of PHP
If you search for the definition of PHP in any search engine, you will find results like this: “Widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.”
Let’s look at the “scripting” part of this definition.
What is scripting?
In programming, we can look at two different approaches: compiled languages and interpreted languages. PHP is one of the interpreted languages.
There are major differences between these two different approaches. If you are typing a C or C++, after writing code, you need to compile the program to get a binary (executable). If you re-run the program, it still works with the same executable. If you change something, you need to compile it again.