PHP compile time vs run time. Understanding the difference
php
Solution
PHP makes two passes (by default) anytime it runs a file.
Pass #1 parses the file and builds what is called operational(or machine) code. This is the raw binary format your computer will actually run and it is not human readable. In other languages (like C++, etc) this is called compiling. You can cache this step using various systems like Opcache, which saves you the overhead of compiling this every time.
Syntax errors come from this portion of the execution.
Pass #2 executes the operational code from Pass #1. This is what is commonly called "run time", because your computer is actually executing the instructions.
Run-time errors (like exhausting memory, abnormal termination, etc) come from this level. These are considerably less common than syntax errors, however.
Problem
I hear those two terms often and keep thinking What is the difference between compile time vs run time in PHP? I have tried reading some articles, but it didn't help. Does anyone know of a simple explanation? How are they different from each other?