Update JSON.php

Fix #1042
Merge pull request #1047 from andig/3.7

Update JSON.php