Jira issue originally created by user hrubi:
Column type json_array can be set to nullable, but if there's null in the database, it is returned as an empty array to PHP.
Null should be returned instead, as that's how the other types behave too.
Comment created by @beberlei:
This was fixed in 2.3.3
Comment created by wildlyinaccurate:
I'm seeing this behaviour again in v2.5.0-BETA3 (6d0b048). If I get time this week I can perform a bisect to figure out when it regressed.
Actually I don't think this was a regression; it looks like a fix was never made. I've opened a PR: #655
Comment created by @doctrinebot:
A related Github Pull-Request [GH-655] was closed:
A related Github Pull-Request [GH-655] was assigned:
Comment created by @ocramius:
Re-opened, as this behavior seems reproducible also in 2.4.x
Comment created by @deeky666:
It was never fixed. That seems to have been a misunderstanding here. As pointed out by [~ocramius] changing this behaviour is a BC break and can't be fixed before 3.0.
Comment created by frickenate:
I spent the time to develop a custom data type to workaround this bug: https://frickenate.com/2014/10/json-data-type-doctrine/ . I can't imagine anybody storing null expecting to receive back an empty array. That would be a fundamental break from the very purpose of the SQL NULL value.
Any status on this for 3.0 or earlier? It is extremely sad that serialization between SQL and PHP is not consistent.
Can this be associated to a different milestone please?