Page 1 of 1

Put breakpoints in the execution of PHP code (breakpoints)

Posted: Thu Feb 13, 2025 5:51 am
by Bappy11
View the state of variables or evaluate expressions (watch),
See the execution stack,
Do profiling (to check which parts of the code are consuming the most resources).
The tool is also integrated into most IDEs (PhpStorm, VSCode, etc.) which simplify its use and provide a graphical interface.
PHPStan on Legacy: A permanent challenge
In 2024, the use of static analysis tools is essential in projects.
During this conference, Frédéric Bouchery presented us the advantages of such tools on code quality and error prevention.

The flagship tool for PHP is PHPStan, its level and baseline file system allows you to increase saudi arabia telegram data your requirements gradually (useful on legacy code). It is recommended to quickly reach level 5 or 6 (typing verification), level 9 is an ambitious goal and should be reserved for new projects.

OpenTelemetry: Standardizing Observability in Drupal
Some reminders on the observability of an application:

WHAT : logs (time-stamped logs of events that took place in the information system),
WHERE : traces (overview of called components),
WHEN : metrics (measurements captured at runtime). OpenTelemetry (Otel) is an open source observability framework with a set of tools (collector, K8s operator, etc.), and which allows to standardize the format of observability data. It is a rather Cloud-oriented solution in its design and it can be integrated into several programming languages ​​via APIs/SDKs, including PHP (stable)! PHP also has an extension to use Otel (the grpc extension is also recommended to avoid using the slower http protocol).