Normalize json across all php versions, fixes #3226