added check for json functions (which were added to php >= 5.2)