This image shows a modern graphic collage depicting stylised hands holding or passing several light bulbs. The light bulbs symbolise ideas and innovations, with their yellow colour immediately catching the eye and conveying a positive, creative impression.

This article is based on a presentation I gave for the first time today at the International PHP Conference in Munich.

Software development is undergoing continuous evolution. While programming languages are advancing technically, the fundamental principles of good software development remain constant: clean, well-documented, and tested code. PHP, as one of the most important languages of the modern web, has undergone remarkable development over the last 30 years: from Rasmus Lerdorf's originally simple CGI scripts to a modern, powerful language that forms the backbone of the modern internet.

Documentation

Documentation often has a reputation for being boring and dry. In one of my first jobs, where I was paid to program in PHP, a lot of documentation was actually produced: printed out, filed away, and then never read again. That was nonsense, of course.

Good and well-maintained documentation on key aspects such as architecture, design, and quality objectives has always been useful, as it provides guidance to those involved in the project. Today, it is more important than ever, because in addition to humans, AI-based coding agents can also use it as a knowledge base.

Architecture Decision Records (ADRs) document important architectural decisions with their justification and expected consequences. This transparent documentation enables teams to understand decisions and revise them in an informed manner if necessary. At the same time, Technical Debt Records document deliberately made technical compromises and their planned resolution.

Quality Goals define measurable quality standards for the entire project. They provide clarity about expectations and form the basis for objective quality assessments. These documented standards are particularly important in times of AI-assisted development, as they can be used as guidelines for automated code generation.

Coding Guidelines

Coding guidelines are not primarily about formatting: this can and should be automated using tools such as PHP-CS-Fixer. The true value of coding guidelines lies in documenting working methods and principles that the entire team has agreed upon. If a team cannot agree on such standards, this indicates underlying communication problems.

Examples of useful coding guidelines:

  • In this project, we use test-driven development
  • Code coverage should be maintained or improved
  • A class must be either abstract or final
  • We prefer immutability over mutability
  • We prefer lists over arrays

These coding guidelines create a common understanding and reduce friction in teamwork.

Tests

PHPStan has become the de facto standard for static code analysis in PHP. The tool analyses code without executing it and identifies potential problems early on in the development phase. PHPStan scores particularly well with its extensive ecosystem of plugins and extensions. There are specialised extensions for virtually every popular PHP framework that understand framework-specific patterns.

Configuration is done via different levels from 0 to 10, which allows for a gradual tightening of the analysis. This is particularly helpful when integrating into existing projects. This flexibility also makes PHPStan a valuable tool for teams that want to modernise legacy code.

PHPUnit is and remains the leading tool for automated testing of PHP-based software. Nowadays, it is considered unprofessional to forego automated testing with PHPUnit (or another framework for test automation).

Mutation testing combines PHPStan and PHPUnit to test tests. To do this, small mutations are injected into the code, which should cause tests to fail. If mutations remain undetected, this reveals gaps in the test suite that cannot be detected by line-based code coverage alone.

AI Assistance

The use of artificial intelligence is currently leading to profound changes in many areas of the working world, and software development is no exception. I have written about this in detail in this article.

Practical experience shows that AI-assisted development only works well if the project has a high degree of automation, comprehensive test coverage is guaranteed, and key aspects such as architecture, design, and quality objectives are documented. This combination of knowledge base and quality assurance measures supports the work of the people involved in the project and makes it possible for the machine in the first place:

  • Test-Driven Development: humans write the tests, coding agent generates the production code
  • High test coverage: automated validation of the generated solutions
  • Clear guidelines: documented standards for code quality and style
  • Robust automation: CI/CD pipelines for continuous integration

In test-driven development with AI support, only humans write the tests, while the coding agent generates the productive code. This approach ensures that the technical requirements are correctly understood and translated into meaningful tests, while the AI focuses on the technical implementation.

Conclusion

Modern PHP development does not mean blindly following the latest trends, but rather combining proven principles with modern tools. Important pillars of a sustainable development strategy are documentation and coding guidelines, static code analysis and automated testing. Such a strategy focuses on both technical excellence and human collaboration. Building on these pillars, AI-assisted tools can be helpful, provided they are operated by a professional.