Fixes upgradephp json_decode behaviour.

fixes #4191