Description
The following code:
<?php
$pdo = new PDO('pgsql:host=pgsql;dbname=foo', 'root', 'secret');
$pdo->exec('DROP TABLE IF EXISTS test');
$pdo->exec('CREATE TABLE test (col_float FLOAT)');
$pdo->exec('INSERT INTO test VALUES (0.125)');
$result = $pdo->query('SELECT col_float FROM test')->fetchColumn();
var_dump($result);
Resulted in this output:
But I expected this output instead:
This behaviour changes in PHP 8.4 (prior this version, you always get string) and seems to affect all float results. This was detected by failing phpstan-doctrine tests where we infer data types returned from drivers.
I didnt find any relevant note about this behaviour change in UPGRADING notes, so this feels unintentional. I suspect #14035 might be the cause.
I can provide fully dockerized repository for reproduction if needed.
PHP Version
PHP 8.4.0beta4
Operating System
Debian 12 (bookworm)