marcoviola15 May 2026 19:12

Found this the hard way. After upgrading to 8.5.0, queries using FETCH_CLASS combined with FETCH_CLASSTYPE silently stopped passing constructor arguments to the class constructor. The third argument to fetchAll() was ignored with no error.

This is a regression tracked in GitHub issue GH-20553. It was fixed in 8.5.2. If you are on 8.5.0 or 8.5.1 and your ORM layer or data mapper passes dependencies through the PDO constructor args mechanism, those objects will be in a broken state since the constructor never ran with the right arguments. No exception, no warning, just silently wrong objects.

Upgrading to 8.5.2 fixes it. Alternatively, skip 8.5.0 and 8.5.1 entirely if you have not upgraded yet.

Replies (3)
dmitry_kv15 May 2026 20:12

Thanks for posting this. We were about to deploy 8.5.0 to staging tomorrow. Will update the Dockerfile to 8.5.2 before running any tests.

0
bohdan_v15 May 2026 21:10

We ran into a related change too: PDO::ATTR_STRINGIFY_FETCHES now converts booleans to “0” and “1”. Before 8.5 it did not touch booleans when STRINGIFY_FETCHES was on. We had tests checking strict equality against false from PDO results that all started failing after the upgrade.

0
marcoviola15 May 2026 22:05

@bohdan_v yeah that one also got us. The fix is straightforward once you know what changed, but connecting failing tests to a PDO attribute behavior change is not obvious. Took a while to track down.

0
Write a reply
Markdown. ```php blocks are runnable.