Execution Time¶
Execution time is a phase of PHP processing, where the source code is executed. It highly depends on the order of execution of the instructions.
At that time, PHP takes the commands one after the other, and execute them. It allocates memory for data, and definitions.
Execution time is related to compile time. Objects, constants when created with define(), function calls, generators, inclusion, exceptions are execution time elements.
On the other hand, classes, constants when created with const, functions, etc. are created at linting time.
<?php
const A = 'a';
function foo(int $a = A) {
echo $a;
}
foo(1); // 1
foo(); // Error
//Uncaught TypeError: foo(): Argument #1 ($a) must be of type int, string given,
?>
Related : Const, define(), Compile Time, Linting, Late Static Binding, max_execution_time