Thinking About PHP Toolchain

Juggling multiple runtimes for various projects has me thinking about how much dealing with PHP is a huge pain in the ass.

Why is that though? Maybe it’s not? Maybe it’s just me? I don’t know.

Why is the Ruby ecosystem so much more pleasant from the developer experience? Why is Go more pleasant? Why do they seem more developer friendly?

And I mean developer friendly as in the operational sense:

  • Easy to install
  • Easy to switch versions
  • Easy to reason about environments
  • Easy to reproduce across machines

Not:

  • Syntax Friendliness
  • Language ergonomics
  • Learning curve

PHP is very beginner-friendly as a language, but not as a toolchain.

Anyway, I think I can answer the question of why.

  • Ruby and Go assume the runtime belongs to the project.
  • PHP assumes the project belongs to the runtime.

From that lens all of the frustration I have with PHP become obvious that I am doing it wrong. I keep trying to manage PHP as if the runtime belongs to the project. The PHP ecosystem feels fragile and unsupported when trying to move responsibility from ops to dev because it is. It is still quite early in the evolution of PHP from an infrastructure based ops managed runtime into a developper managed part of the toolchain.

Some other thoughts:

  • Composer solved only half of the problem. It has made PHP feel modern without modernizing the runtime model. Dependencies are nicely handled though.
  • Docker is an excellent solution for PHP development because it restores PHP to its comfort zone as an ops managed infrastructure.