Portrait Hermann Assmann
Hermann Assmann

Editor, PR and Social Media Manager at +Pluswerk

PHP has become an indispensable programming language in everyday digital life. In this interview, I spoke to three recognised experts about what is important today and what the future holds for this important language.

Ein konzentrierter Entwickler sitzt in einem modernen Büro vor einem großen Monitor und arbeitet an PHP-Code. Die Umgebung ist hell, minimalistisch und professionell, mit klarer Sicht auf weitere Arbeitsplätze im Hintergrund.
PHP is alive - and demands more than ever from developers: vision, quality and continuous improvement.
Logo The PHP Consulting Company

PHP is a programming language that is developing rapidly. We spoke to three leading minds from the well-known consultancy The PHP Consulting Company (thePHP.cc), who have been helping to shape the further development of PHP for years.

The conversation with Stefan Priebsch, Sebastian Bergmann and Arne Blankerts focused on frameworks, migration strategies and modern development processes. Three developers, three perspectives - a conversation about architecture, processes and attitude.

How does the introduction of new PHP versions affect existing projects with an older code base?

Stefan: That depends largely on how up-to-date the project's infrastructure and code are. If the project is running on an older PHP version or an outdated operating system, or if outdated libraries are used, the migration effort when upgrading to a current PHP version is usually significantly higher. Incompatibilities can occur, outdated functions or syntax must be adapted and dependencies must be checked and updated if necessary.

If the code has been continuously adapted to new PHP versions and other dependencies, the effort for an upgrade is of course significantly lower and the migration is usually unproblematic.

Sebastian: If the gap between the currently used and the new PHP version is small, the migration effort is significantly reduced. Fewer outdated functions or syntax changes need to be taken into account. A large version jump, for example from PHP 5 to PHP 8, on the other hand, may require major adjustments to the code and dependencies. In this case, extensive testing is necessary.

Stefan: Projects should follow the PHP release cycle and, for example, install the PHP version released in the fall of the previous year in the summer of a given year. This keeps the code up to date, the migration effort is manageable and the risk of incompatibilities is minimized.

What role does asynchronous programming currently play in PHP projects?

Stefan: PHP has always processed requests in a separate operating system process. This means that the individual requests are well isolated from each other. This isolation ensures security and stability, as errors or memory leaks in one process do not affect the others. However, switching between processes is associated with a certain amount of overhead, which reduces performance when there are many simultaneous requests.

A counter-design to this approach is asynchrony, which has become popular with Node.js, for example. Process isolation is deliberately avoided in order to achieve a higher throughput. Instead, an attempt is made to wait as little as possible for I/O, but instead to carry out further productive work in the running process. However, this requires non-blocking I/O so that the process is not blocked and therefore immediately releases the CPU again.

Although PHP generally supports asynchrony, important extensions such as mysqli are still not non-blocking. This means that applications developed in PHP do not benefit from the performance advantages even if the code is designed similarly to Node.js. Only when the relevant extensions are also non-blocking in the future can this approach be pursued in a meaningful way. However, the problem then arises that in the event of a crash, it is no longer possible to reconstruct the exact state of the application, i.e. which work has already been carried out and which has not. This can be a problem with side effects such as sending emails.

Arne Blankerts

As co-founder and Principal Consultant of The PHP Consulting Company, Arne helps companies to successfully develop and operate software. He is the author and maintainer of various open source development tools and regularly speaks at conferences.

In his spare time, he enjoys reading fantasy books and cooking. Follow Arne on Mastodon.

Profile photo Arne Blankerts
What role does PHP play in combination with microservices and what are the latest developments in this area?

Stefan: PHP is particularly well suited to the implementation and use of microservices, as HTTP requests can be processed in a very lightweight way.

Arne: Modern frameworks support this approach by working ever more efficiently and ensuring that as little framework code as possible has to be executed before the actual business logic is executed.

Stefan: In practice, we often observe that developers implement microservices with PHP, but use the same abstraction layers as for monolithic applications. As a result, the potential of microservices is often not fully exploited. We are seeing a clear trend towards smaller, more specialized services as a result of cloud computing and the increasing availability of specialized services.

Are there any new frameworks or libraries that you find particularly interesting?

Stefan: Exciting new frameworks and libraries appear regularly, which we look at with great interest. However, we usually recommend well-established, tried-and-tested software in order to avoid risks.

Arne: Frameworks such as Symfony and Laravel are tried and tested, stable and offer a high level of security as well as a large community. New frameworks therefore find it difficult to assert themselves against these established solutions.

In your opinion, which design patterns are particularly effective for PHP development?

Stefan: I think design patterns are really important because they can speed up and simplify communication between developers. I recently gave the presentation "Essential Design Patterns" at the International PHP Conference. You can view the slides at the-fluent-developer.com. The patterns that I presented in this talk are exactly the ones that I believe are particularly important for PHP development.

How important are event-driven architectures for large PHP applications and what is the best way to implement them?

Stefan: Since the real world is event-based, I can model it very well with an event-driven architecture.

Sebastian: Such processes are implemented using straightforward, easy-to-understand code. This is not only easy to implement, but also excellent for testing.

Stefan: The introduction of an event-driven architecture also proves to be less complicated than initially assumed. We therefore offer targeted training courses to support teams in implementing and integrating these concepts into existing or new PHP applications.

What principles do you recommend to ensure maintainability and testability over the entire development cycle?

Sebastian: It's very difficult without automated tests.

Stefan: We don't want to have end users testing.

Sebastian: Development should take place step by step and in short cycles so that changes can be integrated and tested quickly and clearly. In this way, the status of the software can be continuously checked and errors are detected at an early stage.

Arne: Another important principle is the regular, automated review of the current status of the software. This ensures that new changes do not have any undesirable side effects. We offer training courses that form the basis for this.

Sebastian: In addition, dependencies such as PHP should be continuously updated, as Stefan suggested earlier, in order to keep the software up to date.

Stefan: Another key success factor is that the entire team defines a common quality standard that is supported by everyone involved, including those outside of development. This makes quality a binding goal that can be enforced throughout the entire development process and ensures maintainability and testability in the long term.

Sebastian Bergmann

Profile photo Sebastian Bergmann

As author and maintainer of PHPUnit and founding partner of The PHP Consulting Company, Sebastian helps teams to implement PHPUnit and improve development processes. He was involved in the founding of the PHP Foundation and is now a board member.

In his spare time he likes to play board games and indulge in retrocomputing with his Amiga 1200. Follow Sebastian on Mastodon.

What tools or approaches are there to make code modern and future-proof?

Stefan: Arne and I are legally obliged to mention PHPUnit here (laughs).

Sebastian: Without tests, there's no guarantee that future changes won't cause unnoticed errors. And yes, I have to mention PHPUnit as a test framework.

Tools such as PHPStan or Psalm analyze the code without executing it and help to detect programming errors such as type inconsistencies at an early stage.

Arne: PHP-CS-Fixer or PHP_CodeSniffer can be used to ensure that the code is formatted consistently. This facilitates collaboration within the team and makes the code easier for other developers to understand. Rector is a tool for automatically modernizing existing code. For example, it can replace old syntax with new language features or adapt code to current best practices or even new framework versions. In this way, the code remains compatible with new PHP versions and benefits from improvements to the language.

Stefan: We are convinced that the open source tools mentioned are an equally good, if not better, choice than commercial products.

Beyond tools, however, I would like to recommend best practices above all: Clean code and the SOLID principles ensure that software remains clearly structured, understandable and flexible. This makes the code easier to maintain, adaptable and can also be developed efficiently in the future. This keeps the code base modern and future-proof.

The integration of AI into our development environments is currently expanding our toolbox considerably. For example, we can ask the IDE to explain, optimize or modernize the currently displayed code. These new possibilities are extremely exciting, but it remains to be seen to what extent they will actually prove themselves in practical use.

How can developers reduce technical debt in legacy projects in a targeted and efficient way?

Arne: The first step is to systematically identify and remove unused code. Tools can help to find code that is no longer being executed, while discussions with stakeholders enable the "sunsetting" of features that are no longer needed. This not only reduces complexity, but also creates mental space for the team.

Stefan: Reducing technical debt is achieved through small, manageable changes. Critical hotspots can be identified through log files in order to prepare the code for an upgrade to a new PHP or framework version, for example. Look at the deprecations and warnings and try to get rid of them. Individual parts of the application can be gradually replaced by newly developed, modern components.

Sebastian: Automated tests ensure stability and minimize risks due to regressions.

Stefan: This combination of targeted clean-up, gradual modernization and robust processes creates a sustainably maintainable code base. Maintenance costs fall, system stability increases and teams gain time to focus on new requirements - a clear return on investment for any company.

How do you deal with outdated PHP frameworks and libraries as part of a modernization strategy?

Stefan: If there is an official migration path for the framework used, it is advisable to use this as the basis for modernization.

Sebastian: Specialized tools such as Rector and automated refactorings as well as AI-supported functions in modern development environments help to carry out recurring adjustments efficiently and with minimal errors.

Arne: With libraries, you should always check first whether a particular library is still needed. Perhaps a newer PHP version offers its functionality directly in the language, or the functionality itself is no longer needed, but the existence of the library is simply forgotten. In this case, it should be removed to streamline the code base. If the library is still relevant, it is important to assess whether an update is possible.

Stefan: If it becomes necessary to switch to an alternative library, it is advisable to use branch-by-abstraction for this switch. Especially if no consistent isolation of dependencies has yet been implemented using dependency inversion.

Which procedures or frameworks are particularly helpful for gradual modernization?

Stefan: It is important to act with foresight and recognize necessary adjustments at an early stage. By integrating planned changes into our development processes in good time, we create the conditions for being able to implement them within a reasonable time frame and without unnecessary time pressure. This allows us to avoid major risks and costly rework.

Sebastian: In order to be able to reliably assess the effects of changes, we first run the existing tests of the project in a separate environment with the new PHP or framework version. In this way, we ensure that potential problems are identified at an early stage without affecting the running production system.

If the project does not have sufficient test coverage, so-called characterization tests can be used as a temporary safeguard. These tests help to compare the current behaviour of the software in different environments and thus ensure that the changes made do not cause any undesirable side effects.

Stefan Priebsch

As managing director and co-founder of The PHP Consulting Company and one of Germany's best-known PHP experts, Stefan advises teams on professional software development. He is the author of several specialist books and helped found the PHP Foundation.

In his spare time, he plays electric guitar and his research focuses on agile DIY. You can find Stefan on LinkedIn.

Bild von Stefan Priebsch
How does PHP development in cloud environments differ from traditional server environments?

Arne: Containers can also be operated in classic server environments without any problems, and conversely, software in the cloud can still be installed in a virtual machine in the traditional way. However, the decisive advantage of containerization is that containers are significantly more resource-efficient and flexible than virtual machines. This is because no hardware has to be emulated for them and no complete operating system is required in the container. This means that the application can be started more quickly and scaled more efficiently. This is why the use of containers is becoming increasingly popular, regardless of whether they run on bare metal, in VMs or in the cloud.

Stefan: Software that is to be operated in the cloud should be more modularized in order to make the most of the cloud's flexibility and scalability. A modular structure makes it easier to develop and test individual components independently of each other and to replace or expand them as required. Numerous specialized services are also available in the cloud, such as for databases or message queues, which can be integrated in a targeted manner. This speeds up development and simplifies maintenance, but can also increase operating costs.

The transition to containerization can initially feel very challenging and sometimes painful for the team, as many technical and organizational problems become apparent right at the start of the project. Difficulties that arise when operating the software in containers must be addressed early on, which makes the transition more complex but ensures greater stability and transparency in the long term.

What PHP-specific best practices do you recommend for continuous integration and deployment?

Sebastian: The industry standards for CI/CD are fundamentally independent of the programming language used. The principles and best practices, such as automated builds, continuous testing and repeatable deployments, apply equally to all modern software projects.

Arne: To ensure that the software status of a project can be reproduced at any time, the composer.lock and composer.json files should be checked into the version management system. In composer.json, the required PHP version must be configured and documented in the same way as the required PHP extensions.

Stefan: With PIE (PHP Installer for Extensions), the PHP project is currently working on a solution to close the previous gap in the management of PHP extensions. While Composer can declare dependencies on extensions but cannot install them itself, PIE enables a modern, Composer-like workflow for the installation and management of PHP extensions for the first time.

What PHP-specific challenges arise when using Kubernetes?

Stefan: Kubernetes is used to orchestrate containers, for example, to restart containers whose process has crashed.

Arne: Containers are designed to encapsulate exactly one running process that remains active for the entire lifetime of the container. If this main process is terminated, the container is also stopped and removed.

Stefan: As the PHP interpreter is not designed as a permanently running process, it is not suitable as the main process for a container. As with operating concepts without containers, the solution is to use the FastCGI Process Manager (PHP-FPM): this can be executed as a long-lived process in a container and delegates the execution of PHP code for incoming requests to the PHP interpreter, which processes the requests in separate processes.

Against this background, it becomes clear why running a PHP application in a container under Kubernetes has slightly different challenges than, for example, a Node.js application, which has its own permanently running server process.

What role does Infrastructure as Code (IaC) play in PHP projects in DevOps environments?

Arne: Infrastructure as Code (IaC) is independent of the programming language used and plays a central role in automating the installation and configuration of the development and operating environment. The aim is to be able to set up the environment required to run the software reproducibly and reliably at all times.

Stefan: On a classic server, the scaling of a PHP application is initially achieved by adapting the PHP-FPM configuration, for example by increasing the number of worker processes. If the requirements continue to increase, horizontal scaling is achieved by providing additional servers with further PHP FPM instances. At this point at the latest, Infrastructure as Code (IaC) becomes indispensable, as manual administration and configuration of the infrastructure becomes too time-consuming and error-prone.

Conclusion: Between code, test and mindset

Whether it's the migration of old frameworks, the introduction of tests or the containerization of applications: Anyone working with PHP will find numerous practical ideas in this interview. Arne, Sebastian and Stefan make it clear that good software is not created through tooling alone, but through principles, discipline and teamwork.

At the same time, they provide encouragement: even complex modernizations can be implemented efficiently through small steps, targeted analysis and suitable tools. Those who plan, test and automate at an early stage ensure long-term maintainability and strengthen the resilience of their software. An investment that pays off in every project.

From legacy to leading edge.

Whether outdated frameworks, missing tests or PHP upgrades - we work with you and your team to develop a clear strategy for sustainable modernisation.

Get in touch and start modernisation

info(at)pluswerk(dot)ag