Table of Contents
PHP Primer for the AI Era
— a gentle guide for the human part of the collaboration
This Primer is not a syntax reference. Its purpose is to help programmers develop a modern mental model of PHP and collaborate effectively with AI while remaining responsible for the decisions that matter.
'PHP Primer for the Ai Era' is a thought in motion.
An approach to judgment rather than rules.
A framework for thinking about PHP at a time when keeping our agency matters.
Modern tools can write PHP for us,
but only humans can look at code, understand the context,
recognize structure, and decide whether that code belongs in a project.
This primer proposes the mental models needed to
- understand the shape of PHP 8+
- recognize modern patterns and idioms
- evaluate AI‑generated code with clarity
- spot subtle errors, risks, and outdated practices
- guide AI toward better architecture and safer decisions
A mental model is the internal picture we carry of how something works —not the details, but the shape of the system. It’s a lens that lets us see what belongs, what doesn’t, and when code is moving with or against the grain of the language.
This primer is written for developers who already know the basics of PHP and want to strengthen their understanding in a calm, structured way.
It's for those who want to collaborate with AI without surrendering judgment or losing their agency.
It's designed for multiple visits, a place to return to whenever a concept, pattern, or decision deserves a second look.
A note on syntax:
For a compact syntax reference, consider Michael Olson's PHP 8 Quick Scripting Reference (3rd edition or later). No affiliation. Just a useful reference worth revisiting occasionally.
Start Here
Note: The “Appendix 101” is a PHP quick mental model reference specifically designed for this project. One could start there as a refresher, but, for the most part, beginning at the PHP Mental Model section is preferred.
Philosophy
While AI→ can write code,
Humans→ design systems.
This primer focuses on the parts that → only humans can do well.
Like:
- understanding context
- maintaining coherence
- choosing the right abstraction
- protecting the architecture
- keeping the code humane and readable
AI can remember the details.
We provide the judgment.
This primer helps us stay in that role—with
clarity and confidence.
Dealing with modern AI coding
is less about prompting
and more about
context engineering
— shaping the environment
in which the model reasons.
The Zen of AI-ing
This wiki is not “how to use AI,”
it’s more like how to be with AI
— how to think,
how to guide,
how to stay grounded while the machine drafts around us,
while we experiment with possibilities.
A Zen like posture:
- trust when the shape is right
- rewrite when the shape is wrong
- don’t fight complexity — dissolve it
- don’t cling to drafts — let them go
- clarity over cleverness
- intent over decoration
- architecture over noise
About This Project
This wiki is part of an ongoing effort to document a modern approach to PHP development in the age of AI‑assisted coding.
- Suggested next reading:
1. Understanding How PHP Thinks
Written, curated and maintained by
Tony de Araujo
—New York | Lisbon
a labor of love
- Top↑
DokuWiki release: “Mort”, using the Navigator theme.
