pdo_snowflake
pdo_snowflake copied to clipboard
PDO driver returns empty strings instead of NULL values under PHP 8.1
Summary: while testing one of our applications using the latest pdo_snowflake driver and PHP 8.1, we noticed that we are getting no longer getting NULL values when queries return them; instead, we get empty strings, which are different.
Details: Using the latest version of the driver (https://github.com/snowflakedb/pdo_snowflake/commit/80e0a154f1b13c6d7dc0ad09ce81ed6a7c854393), queries that returned NULL values with PHP 8.0 are now returning empty strings using the PDO fetchAll() method
Sample code to reproduce ($this->pdo is connected to Snowflake):
$query = $this->pdo->prepare("SELECT NULL");
$query->execute();
var_dump($query->fetchAll());
Seems like this might be related to the changes here? https://github.com/snowflakedb/pdo_snowflake/pull/270/files#diff-4de04c00f840c1eaea68b91749199fdd1268bdf7a63b632e71ec68a9ec46c581R667