Symfony 4.4 LTS: HttpClient, Mailer, Messenger, and the features that stayed

Symfony 4.4 and 5.0 both landed November 21, 2019. 4.4 is the LTS: same feature set as 5.0, deprecation layer baked in, and a long support window for teams that can’t follow every release. The feature worth singling out arrived in 4.2 and matured through 4.3 and 4.4: HttpClient. HttpClient PHP’s built-in HTTP options (file_get_contents with stream contexts, cURL, Guzzle) each have their own model, their own quirks, and their own abstraction cost. Symfony 4.2 introduced HttpClient, a first-party HTTP client with one API over multiple transports. ...

January 4, 2020 · 7 min · Guillaume Delré

From a €10 sensor to a Home Assistant dashboard with a Raspberry Pi and MQTT

The question was simple: what’s the temperature and humidity in my home office right now? Not the weather outside, not a city average — the actual conditions in the room where I spend most of my day. Opening a weather app for that felt wrong. A Raspberry Pi was already running on the shelf. A BME280 sensor costs around €10. This should have been a weekend project. It mostly was, except for the part where I assumed reading a temperature sensor meant reading a register. ...

November 17, 2019 · 4 min · Guillaume Delré

PHP 7.3: small wins that add up

PHP 7.3 shipped December 6th. No single killer feature. It’s a collection of quality-of-life improvements that individually feel minor but together make daily work noticeably less annoying. Flexible heredoc and nowdoc Until 7.3, the closing marker of a heredoc had to be at column zero. That forced awkward de-indentation in otherwise well-formatted code: // before $html = <<<HTML <div> <p>Hello</p> </div> HTML; // had to be at column 0, ugly // after $html = <<<HTML <div> <p>Hello</p> </div> HTML; The closing marker can now be indented to match the surrounding code, and that indentation is stripped from the content. This looks cosmetic. It’s not. Heredocs in nested contexts (class methods, conditionals) were visually jarring before. Now they fit. ...

January 20, 2019 · 6 min · Guillaume Delré

PHP 7.2: goodbye mcrypt, hello sodium

PHP 7.2 released November 30th. The headline isn’t a language feature, it’s a removal. mcrypt is gone. This is good news, even if it doesn’t feel that way when you’re the one migrating. The mcrypt problem mcrypt has been unmaintained since 2007. More than a decade of stagnation in a cryptography library. It was deprecated in 7.1, and 7.2 removes it entirely. The replacement is sodium, now bundled as a core extension. ...

January 14, 2018 · 6 min · Guillaume Delré

Symfony 4.0: Flex and the end of the Standard Edition

Symfony 4.0 released November 30, 2017, same day as 3.4. The shared release date is pretty much the only thing they have in common. 4.0 is a different philosophy. The Symfony Standard Edition, the monolithic starting point that bundled everything and left you to remove what you didn’t need, is gone. In its place: a microframework that grows. Flex Symfony Flex is a Composer plugin that changes how you install Symfony packages. Before Flex, adding a bundle meant: install via Composer, register in AppKernel.php, add config to config/, update routing if needed. Four steps, all manual. ...

January 14, 2018 · 5 min · Guillaume Delré

Symfony 3.4 LTS: the bridge you actually want to cross

Symfony 3.4 and 4.0 were released the same day: November 30, 2017. That’s not a coincidence, it’s the strategy. 3.4 is not a feature release. It ships with exactly the same features as 3.3, plus every deprecation warning that 4.0 will enforce. Its whole purpose is to be the migration tool: upgrade from 3.3 to 3.4, fix what’s in your logs, then step to 4.0 cleanly. Why LTS releases matter in Symfony’s model Symfony releases a new minor version every six months. That pace would be brutal for production apps to follow, so the project designates every fourth minor as an LTS: three years of bug fixes, four of security fixes. Which means teams can target 3.4 and mostly stop thinking about upgrades for a while. ...

January 12, 2018 · 6 min · Guillaume Delré

Symfony 3.3: when services stopped being a configuration nightmare

Symfony 3.3 shipped May 29th. It’s the release that changed how I think about service configuration. In hindsight, it was basically a preview of what 4.0 would make the new default. The autowiring problem Before 3.3, Symfony’s DI was powerful but verbose. Every service had to be declared explicitly in services.yml with its arguments listed. Autowiring existed since 3.1, but it was opt-in per service and had enough edge cases to bite you. Teams either wrote mountains of YAML or leaned on third-party bundles to cut the noise. ...

July 13, 2017 · 5 min · Guillaume Delré

Controlling a USB missile launcher over HTTP with FastAPI and Docker

The rule was simple: whoever breaks the CI build owes the team a coffee. It worked fine for a while. Then someone suggested we needed something with more immediate feedback. Something physical. Something that fires. A Dream Cheeky Thunder appeared on a desk shortly after. Four foam missiles, a USB cable, and a very clear team consensus: hook it to the cluster, wire it to the build pipeline, and let the CI decide who deserves a volley. ...

February 21, 2017 · 4 min · Guillaume Delré

Enforcing UTC in Doctrine without touching your entities

A timestamp coming back from the database one hour off. Not every time. Only when the dev server runs in Europe/Paris and CI runs in UTC. The kind of bug that disappears when you look for it and comes back in production on a Friday evening. The problem isn’t in the business logic. It’s in what Doctrine quietly does with dates. What Doctrine does by default When you declare a datetime field in a Doctrine entity, the conversion between PHP and the database goes through DateTimeType. That class calls format() on your DateTime object to write to the database, and DateTime::createFromFormat() to read it back. No mention of timezone anywhere. ...

February 19, 2017 · 4 min · Guillaume Delré

PHP 7.1: a tighter type system and the small wins around it

PHP 7.1 shipped December 1st. No 2x performance headline, no engine rewrite. It fills in the gaps that 7.0 left in the type system, and those gaps were genuinely annoying. Nullable types 7.0 let you declare string $name as a parameter type. What it didn’t let you do was say “this can also be null”. You had to drop the type hint entirely or hack around it. 7.1 adds ? prefix: ...

January 15, 2017 · 4 min · Guillaume Delré