I recently added a note to a small function that went through the results of PDOStatement::fetch and mapped columns to integer or float types.
I forgot to test for columns that can have a null value!
I'm updating the code here, sorry.
This website doesn't let me edit the original comment, so I'm just gonna link to a gist in case it needs even further fixes.
https://gist.github.com/AeonFr/db3b2a8a95753076d9e4da42d29365d2
I basically added this code:
<?php
if ($value === null) {
continue;
}
?>