fixes #505 added JSON_PRETTY_PRINT for php >= 5.4.0

added php version check and JSON_PRETTY_PRINT option
Why not use `defined('JSON_PRETTY_PRINT')`?